How to use the json-stringify-safe.apply function in json-stringify-safe

To help you get started, we’ve selected a few json-stringify-safe 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 tedeh / jayson / lib / utils.js View on Github external
Utils.JSON.stringify = function(obj, options, callback) {
  let replacer = null;
  let str = null;
  options = options || {};

  if(isFunction(options.replacer)) {
    replacer = options.replacer;
  }

  try {
    str = JSONstringify.apply(JSON, compact([obj, replacer]));
  } catch(err) {
    return callback(err);
  }

  callback(null, str);
};
github 1PhoenixM / avior-service / node_modules / sails / node_modules / sails-util / index.js View on Github external
exports.stringify = function ( json, serializer, indent, decycler ) {
	var args = Array.prototype.slice.call(arguments);
	try {
		return safeStringify.apply(this, args);
	}
	catch (e) {
		return false;
	}
};
github misspink1011 / News-Manager / web_server / server / node_modules / jayson / lib / utils.js View on Github external
Utils.JSON.stringify = function(obj, options, callback) {
  var replacer = null;
  var str = null;
  options = options || {};

  if(_.isFunction(options.replacer)) {
    replacer = options.replacer;
  }

  try {
    str = JSONstringify.apply(JSON, _.compact([obj, replacer]));
  } catch(err) {
    return callback(err);
  }

  callback(null, str);
};
github balderdashy / sails / util / index.js View on Github external
exports.stringify = function ( json, serializer, indent, decycler ) {
	var args = Array.prototype.slice.call(arguments);
	try {
		return safeStringify.apply(this, args);
	}
	catch (e) {
		return false;
	}
};
github balderdashy / sails / util / index.js View on Github external
exports.stringify = function ( json, serializer, indent, decycler ) {
	var args = Array.prototype.slice.call(arguments);
	try {
		return safeStringify.apply(this, args);
	}
	catch (e) {
		return false;
	}
};

json-stringify-safe

Like JSON.stringify, but doesn't blow up on circular refs.

ISC
Latest version published 9 years ago

Package Health Score

71 / 100
Full package analysis

Popular json-stringify-safe functions