How to use the json.parse function in json

To help you get started, we’ve selected a few json 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 kissyteam / kissy / src / editor / sub-modules / plugin / draft / src / draft.js View on Github external
_getDrafts: function () {
        var self = this;
        if (!self.drafts) {
            var str = localStorage.getItem(self._getSaveKey()),
                drafts = [];
            if (str) {
                // 原生 localStorage 必须串行化
                drafts = (localStorage === window.localStorage) ?
                    Json.parse(util.urlDecode(str)) : str;
            }
            self.drafts = drafts;
        }
        return self.drafts;
    },
github kissygalleryteam / offline / 2.5.0 / kissy5.0_code / ie-offline.js View on Github external
init: function () {
		oIeOffline = doc.createElement('link');
		if (oIeOffline.addBehavior) {
			oIeOffline.style.behavior = 'url(#default#userData)';
			doc.getElementsByTagName('head')[0].appendChild(oIeOffline);
		}
		oIeOffline.load(IE_OFFLINE);
		oGlobal = Json.parse(oIeOffline.getAttribute(SINGLE_KEY)) || {};
		oDeadline = Json.parse(oIeOffline.getAttribute(TIME_DEADLINE)) || {};
		//var dateNow = new Date().getTime();
		this._initDeadline();
		return this;
	},
	/**
github kissyteam / kissy / src / editor / sub-modules / plugin / draft / coverage / src / draft.js View on Github external
_getDrafts: function() {
  _$jscoverage['/draft.js'].functionData[5]++;
  _$jscoverage['/draft.js'].lineData[74]++;
  var self = this;
  _$jscoverage['/draft.js'].lineData[75]++;
  if (visit6_75_1(!self.drafts)) {
    _$jscoverage['/draft.js'].lineData[76]++;
    var str = localStorage.getItem(self._getSaveKey()), drafts = [];
    _$jscoverage['/draft.js'].lineData[78]++;
    if (visit7_78_1(str)) {
      _$jscoverage['/draft.js'].lineData[80]++;
      drafts = (visit8_80_1(localStorage === window.localStorage)) ? Json.parse(util.urlDecode(str)) : str;
    }
    _$jscoverage['/draft.js'].lineData[83]++;
    self.drafts = drafts;
  }
  _$jscoverage['/draft.js'].lineData[85]++;
  return self.drafts;
}, 
  _init: function() {
github kissygalleryteam / offline / 2.5.0 / build / ie-offline.js View on Github external
init: function () {
		oIeOffline = doc.createElement('link');
		if (oIeOffline.addBehavior) {
			oIeOffline.style.behavior = 'url(#default#userData)';
			doc.getElementsByTagName('head')[0].appendChild(oIeOffline);
		}
		oIeOffline.load(IE_OFFLINE);
		oGlobal = Json.parse(oIeOffline.getAttribute(SINGLE_KEY)) || {};
		oDeadline = Json.parse(oIeOffline.getAttribute(TIME_DEADLINE)) || {};
		//var dateNow = new Date().getTime();
		this._initDeadline();
		return this;
	},
	/**
github jondubois / nombo / node_modules / ndata / formatter.js View on Github external
module.exports.parse = function(buffer, skipRetrocycle)  {
	var firstParse = json.parse(buffer.toString());
	var secondParse;
	var i;
	if(skipRetrocycle) {
		secondParse = firstParse;
	} else {
		secondParse = cycle.retrocycle(firstParse);
	}
	return secondParse;
}
github Houfeng / mokit / v2 / lib / ems-json.js View on Github external
require('ems-text!' + uri, function(rs) {
            onLoad(json.parse(rs));
        });
    };
github kissygalleryteam / offline / 2.5.0 / kissy5.0_code / localstorage.js View on Github external
init: function () {
		var initDate = new Date().getTime();
		ls = localStorage;
		oDeadline = Json.parse(ls.getItem(DEADLINE_KEY)) || {};
		//遍历oDeadline里面所有设置了过期时间的key
		for (var i in oDeadline) {
			if (oDeadline.hasOwnProperty(i)) {
				dateKey = parseInt(oDeadline[i], 10);
				dateBet = dateKey - initDate;
				if (dateBet <= 0) {
					this.removeItem(i);
					delete oDeadline[i];
					this._saveDeadLine();
				} else {
					this._deadlineKey(i, dateBet);
				}
			}
		}
		return this;
	},
github jondubois / nombo / bin / cli.js View on Github external
var parsePackageFile = function(moduleDir) {
	var packageFile = moduleDir + '/package.json';
	try {
		if(fs.existsSync(packageFile)) {
			return json.parse(fs.readFileSync(packageFile, 'utf8'));
		}
	} catch(e) {}
	
	return {};
}
github jondubois / nombo / node_modules / ncom / formatter.js View on Github external
module.exports.parse = function (buffer, skipRetrocycle) {
	var firstParse = json.parse(buffer.toString());
	var secondParse;
	var i;
	if (skipRetrocycle) {
		secondParse = firstParse;
	} else {
		secondParse = cycle.retrocycle(firstParse);
	}
	return secondParse;
};
github kissygalleryteam / offline / 2.5.0 / build / index.js View on Github external
init: function () {
		oIeOffline = doc.createElement('link');
		if (oIeOffline.addBehavior) {
			oIeOffline.style.behavior = 'url(#default#userData)';
			doc.getElementsByTagName('head')[0].appendChild(oIeOffline);
		}
		oIeOffline.load(IE_OFFLINE);
		oGlobal = Json.parse(oIeOffline.getAttribute(SINGLE_KEY)) || {};
		oDeadline = Json.parse(oIeOffline.getAttribute(TIME_DEADLINE)) || {};
		//var dateNow = new Date().getTime();
		this._initDeadline();
		return this;
	},
	/**