Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_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;
},
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;
},
/**
_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() {
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;
},
/**
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;
}
require('ems-text!' + uri, function(rs) {
onLoad(json.parse(rs));
});
};
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;
},
var parsePackageFile = function(moduleDir) {
var packageFile = moduleDir + '/package.json';
try {
if(fs.existsSync(packageFile)) {
return json.parse(fs.readFileSync(packageFile, 'utf8'));
}
} catch(e) {}
return {};
}
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;
};
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;
},
/**