JSON.stringify the object and put back in localStorage
170491
function (err) {
		var storage = getStorage();
		if (storage && storage.errors) {
			storage.errors.push(err);
			return localStorage.setItem([config.nameSpace], JSON.stringify(storage));
		}
	}
492824
function stringifyObject(obj, prefix) {
  var ret = []
    , keys = objectKeys(obj)
    , key;
  for (var i = 0, len = keys.length; i < len; ++i) {
    key = keys[i];
    ret.push(stringify(obj[key], prefix
      ? prefix + '[' + encodeURIComponent(key) + ']'
      : encodeURIComponent(key)));
  }
  return ret.join('&');
}
774456
function LocalStorageHandle(success, error, intent, operation, args) {
    var reference = args[0];
    var variable = args[1];

    if (operation.startsWith('put') || operation.startsWith('set')) {
        try {
            var varAsString = JSON.stringify(variable);
            if (reference === null) {
                error(NativeStorageError.NULL_REFERENCE);
                return;
            }
            localStorage.setItem(reference, varAsString);
            success(variable);
        } catch (err) {
            error(NativeStorageError.JSON_ERROR);
        }
    } else if (operation.startsWith('get')) {
        var item = {};
        item = localStorage.getItem(reference);
        if (item === null) {
            error(NativeStorageError.ITEM_NOT_FOUND);
            return;
        }
        try {
            var obj = JSON.parse(item);
            //console.log("LocalStorage Reading: "+obj);
            success(obj);
        } catch (err) {
            error(NativeStorageError.JSON_ERROR);
        }
    } else if (operation === 'keys') {
      var keys = [];
      for(var i = 0; i < localStorage.length; i++){
         keys.push(localStorage.key(i));
      }
      success(keys);
    }
}
486689
function(){
    var cached = {};
    var obj = {
        a: [1, 2, 3]
    }, json = "{\"a\":[1,2,3]}";
    
    if (typeof JSON != "undefined" && typeof JSON.stringify === "function" && JSON.stringify(obj).replace((/\s/g), "") === json) {
        // this is a working JSON instance
        return JSON;
    }
    if (Object.toJSON) {
        if (Object.toJSON(obj).replace((/\s/g), "") === json) {
            // this is a working stringify method
            cached.stringify = Object.toJSON;
        }
    }
    
    if (typeof String.prototype.evalJSON === "function") {
        obj = json.evalJSON();
        if (obj.a && obj.a.length === 3 && obj.a[2] === 3) {
            // this is a working parse method           
            cached.parse = function(str){
                return str.evalJSON();
            };
        }
    }
    
    if (cached.stringify && cached.parse) {
        // Only memoize the result if we have valid instance
        getJSON = function(){
            return cached;
        };
        return cached;
    }
    return null;
}
327916
function simpleStringify (object) {
	var simpleObject = {};
	for (var prop in object) {
		if (!object.hasOwnProperty(prop) ||
			typeof(object[prop]) === 'function') {
			continue;
		}
		simpleObject[prop] = object[prop];
	}
	return JSON.stringify(simpleObject, censor(simpleObject),2);
}
1016052
function _stringify(vObject) {
		var sData = "", sProp;
		var type = typeof vObject;

		if (vObject == null || (type != "object" && type != "function")) {
			sData = vObject;
		} else if (isPlainObject(vObject)) {
			sData = JSON.stringify(vObject);
		} else if (vObject instanceof ManagedObject) {
			sData = vObject.getId();//add the id
			for (sProp in vObject.mProperties) {
				sData = sData + "$" + _stringify(vObject.mProperties[sProp]);
			}
		} else if (Array.isArray(vObject)) {
			for (var i = 0; vObject.length; i++) {
				sData = sData + "$" + _stringify(vObject);
			}
	    } else {
			Log.warning("Could not stringify object " + vObject);
			sData = "$";
		}

		return sData;
	}
439073
function objectify (obj) {
  return JSON.parse(JSON.stringify(obj, Object.getOwnPropertyNames(obj)))
}
792280
function serialize(object) {
	function replacer(key, value) {
		if (typeof value === 'string' && value.match(ISO8601_DATE_REGEX)) {
			value = new Date(value);
			value = value.toISOString();
		}
		return value;
	}

	return JSON.stringify(object, replacer);
}
442687
function stringifyObject(object, replacer, space, indent) {
  let childIndent = space ? (indent + space) : undefined;
  let first = true;
  let str = space ? '{\n' : '{';

  if (typeof object.toJSON === 'function') {
    return stringify(object.toJSON(), replacer, space);
  }

  // check for circular reference
  if (isCircular(object)) {
    return stringifyCircular(object, replacer, space, indent);
  }

  // add this object to the stack
  const stackIndex = stack.length;
  stack[stackIndex] = object;

  for (let key in object) {
    if (object.hasOwnProperty(key)) {
      let value = (typeof replacer === 'function')
          ? replacer.call(object, key, object[key])
          : object[key];

      if (includeProperty(key, value, replacer)) {
        if (first) {
          first = false;
        }
        else {
          str += space ? ',\n' : ',';
        }

        str += space
            ? (childIndent + '"' + key + '": ')
            : ('"' + key + '":');

        path[stackIndex] = key;
        str += stringifyValue(value, replacer, space, childIndent);
      }
    }
  }

  // remove current entry from the stack
  stack.length = stackIndex;
  path.length = stackIndex;

  str += space ? ('\n' + indent + '}') : '}';
  return str;
}
1368044
function stringify(obj, replacer, spaces, cycleReplacer) {
  var myserializer = serializer(replacer, cycleReplacer), ret = JSON.stringify(obj, myserializer, spaces);
  myserializer.destroy();
  return ret;
}
845647
function stringifyParams (obj) {
    return obj ? arrayMap(objectKeys(obj).sort(), function (key) {
      var val = obj[key]

      if (angular.isArray(val)) {
        return arrayMap(val.sort(), function (val2) {
          return encodeURIComponent(key) + '=' + encodeURIComponent(val2)
        }).join('&')
      }

      return encodeURIComponent(key) + '=' + encodeURIComponent(val)
    }).join('&') : ''
  }
1236940
function stringify (val) {
  var stack = val.stack

  if (stack) {
    return String(stack)
  }

  var str = String(val)

  return str === toString.call(val)
    ? inspect(val)
    : str
}
242687
function stringifyQueryStr(obj) {
      if (!typeOf(obj, 'obj', 'arr')) return '';
      obj = JSON.parse(JSON.stringify(obj));
      var pairs = [];
      forIn(obj, function (key, value) {
        var encode = encodeURIComponent;
        pairs.push(encode(key) + '=' + encode(value));
      });
      return '?' + pairs.join('&');
    }
178722
function LocalStorage (params) {
  events.EventEmitter.call(this);

  if (!params || typeof params === 'string') {
    params = {
      ns: params || ''
    };
  }

  this.ns = params.ns || '';

  if (typeof this.ns !== 'string') {
    throw new Error('Namespace must be a string.');
  }

  this.preSave = params.preSave || defProcessor;
  this.postLoad = params.postLoad || defProcessor;

  if (this.preSave && typeof this.preSave !== 'function') {
    throw new Error('preSave option must be a function');
  }

  if (this.postLoad && typeof this.postLoad !== 'function') {
    throw new Error('postLoad option must be a function');
  }

  this.EVENTS = EVENTS;
}
1250382
function clone(obj, json) {
    if (json)
        return JSON.parse(JSON.stringify(obj));
    return _clone(obj);
}
1018259
function (rules) {
			var stringifyRules = encode(JSON.stringify(rules));
			localStorage.setItem(constants.LOCAL_STORAGE_TEMP_RULES_KEY, stringifyRules);
		}
1187520
function stringify(obj, callback) {
	process.nextTick(function () {
		var str = stringifySync(obj);
		callback(str);
	});
}