How to use stringify-object - 10 common examples

To help you get started, we’ve selected a few stringify-object examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github umijs / umi / packages / umi-build-dev / src / plugins / commands / config.js View on Github external
function get(key) {
    if (api.config[key]) {
      console.log(
        stringifyObject(api.config[key], {
          indent: '  ',
        }),
      );
    }
  }
github react-display-window / react-display-window / src / utils / to-jsx-string.js View on Github external
function renderObjectProp(prop) {
  const [ key, value ] = prop;
  if (value === true) {
    return key;
  }
  console.log(value);
  const valueStr = improveCurly(sobj(value, { indent: '  ', inlineCharacterLimit: 50 }));
  return `${key}={${valueStr}}`;
}
github ritz078 / transform / pages / json-to-mongoose.js View on Github external
getTransformedValue = newValue => {
    const value = JSON.parse(newValue);
    return stringify(mongoose(value));
  };
github alienfast / gulp-pipeline / dist / gulp-pipeline.es.js View on Github external
registerTask(taskName) {
    this.debug(`Registering task: ${Util.colors.green(taskName)} for ${stringify(this.toTaskNames(this.recipes))}`)
    this.gulp.task(taskName, this.createHelpText(), () => {
      return this.run(this.recipes)
    })
  }
github hannupekka / jsonni / src / containers / App.jsx View on Github external
parseInput = input => {
    const isInputJSON = this.isJSON(input);

    const tabSize = new Array(MIRROR_OPTIONS.tabSize + 1).join(" ");
    return isInputJSON
      ? prettify.json(JSON.stringify(JSON.parse(input)), tabSize, true)
      : stringify(convertToObject(input), { singleQuotes: false });
  };
github hannupekka / jsonni / src / app.js View on Github external
const parseInput = input => {
  const text = input.join();
  const isInputJSON = isJSON(text);

  return isInputJSON
    ? JSON.stringify(JSON.parse(text), null, 2)
    : stringify(convertToObject(text), { singleQuotes: false });
};
github react-display-window / react-display-window / lib / utils / to-jsx-string.js View on Github external
function renderObjectProp(prop) {
  var _prop2 = _slicedToArray(prop, 2),
      key = _prop2[0],
      value = _prop2[1];

  if (value === true) {
    return key;
  }

  var valueStr = improveCurly(sobj(value, {
    indent: '  ',
    inlineCharacterLimit: 50
  }));
  return "".concat(key, "={").concat(valueStr, "}");
}
github ansumanshah / css-in-js / packages / atom-css-in-js / lib / convertCSS.js View on Github external
let getSnippet = snippet => {
  switch (atom.config.get('css-in-js.cssInJsOptions.snippet')) {
    case 'glamorous':
      return `const ${toUpperCamel(
        snippet.key
      )} = glamorous.div(${stringifyObject(snippet.style, {
        indent: '  ',
        singleQuotes: true,
      })})`
    case 'glamor':
      return `const ${toCamel(
        snippet.key
      )} = css(${stringifyObject(snippet.style, {
        indent: '  ',
        singleQuotes: true,
      })})`
  }
}
let toJS = (rules, options) => {

stringify-object

Stringify an object/array like JSON.stringify just without all the double-quotes

BSD-2-Clause
Latest version published 1 year ago

Package Health Score

77 / 100
Full package analysis

Popular stringify-object functions