nav tabs on admin dashboard
This commit is contained in:
42
node_modules/serialize-javascript/index.js
generated
vendored
42
node_modules/serialize-javascript/index.js
generated
vendored
@@ -11,8 +11,11 @@ var UID = Math.floor(Math.random() * 0x10000000000).toString(16)
|
||||
var PLACE_HOLDER_REGEXP = new RegExp('"@__(F|R|D)-' + UID + '-(\\d+)__@"', 'g');
|
||||
|
||||
var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g;
|
||||
var IS_PURE_FUNCTION = /function.*?\(/;
|
||||
var UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g;
|
||||
|
||||
var RESERVED_SYMBOLS = ['*', 'async'];
|
||||
|
||||
// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their
|
||||
// Unicode char counterparts which are safe to use in JavaScript strings.
|
||||
var ESCAPED_CHARS = {
|
||||
@@ -68,6 +71,38 @@ module.exports = function serialize(obj, options) {
|
||||
return value;
|
||||
}
|
||||
|
||||
function serializeFunc(fn) {
|
||||
var serializedFn = fn.toString();
|
||||
if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) {
|
||||
throw new TypeError('Serializing native function: ' + fn.name);
|
||||
}
|
||||
|
||||
// pure functions, example: {key: function() {}}
|
||||
if(IS_PURE_FUNCTION.test(serializedFn)) {
|
||||
return serializedFn;
|
||||
}
|
||||
|
||||
var argsStartsAt = serializedFn.indexOf('(');
|
||||
var def = serializedFn.substr(0, argsStartsAt)
|
||||
.trim()
|
||||
.split(' ')
|
||||
.filter(function(val) { return val.length > 0 });
|
||||
|
||||
var nonReservedSymbols = def.filter(function(val) {
|
||||
return RESERVED_SYMBOLS.indexOf(val) === -1
|
||||
});
|
||||
|
||||
// enhanced literal objects, example: {key() {}}
|
||||
if(nonReservedSymbols.length > 0) {
|
||||
return (def.indexOf('async') > -1 ? 'async ' : '') + 'function'
|
||||
+ (def.join('').indexOf('*') > -1 ? '*' : '')
|
||||
+ serializedFn.substr(argsStartsAt);
|
||||
}
|
||||
|
||||
// arrow functions
|
||||
return serializedFn;
|
||||
}
|
||||
|
||||
var str;
|
||||
|
||||
// Creates a JSON string representation of the value.
|
||||
@@ -108,12 +143,7 @@ module.exports = function serialize(obj, options) {
|
||||
}
|
||||
|
||||
var fn = functions[valueIndex];
|
||||
var serializedFn = fn.toString();
|
||||
|
||||
if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) {
|
||||
throw new TypeError('Serializing native function: ' + fn.name);
|
||||
}
|
||||
|
||||
return serializedFn;
|
||||
return serializeFunc(fn);
|
||||
});
|
||||
}
|
||||
|
||||
16
node_modules/serialize-javascript/package.json
generated
vendored
16
node_modules/serialize-javascript/package.json
generated
vendored
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "serialize-javascript@^1.4.0",
|
||||
"_id": "serialize-javascript@1.5.0",
|
||||
"_id": "serialize-javascript@1.6.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==",
|
||||
"_integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==",
|
||||
"_location": "/serialize-javascript",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -16,12 +16,12 @@
|
||||
"fetchSpec": "^1.4.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/uglifyjs-webpack-plugin"
|
||||
"/terser-webpack-plugin"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz",
|
||||
"_shasum": "1aa336162c88a890ddad5384baebc93a655161fe",
|
||||
"_resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz",
|
||||
"_shasum": "4d1f697ec49429a847ca6f442a2a755126c4d879",
|
||||
"_spec": "serialize-javascript@^1.4.0",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\uglifyjs-webpack-plugin",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\terser-webpack-plugin",
|
||||
"author": {
|
||||
"name": "Eric Ferraiuolo",
|
||||
"email": "edf@ericf.me"
|
||||
@@ -36,7 +36,7 @@
|
||||
"benchmark": "^2.1.4",
|
||||
"chai": "^4.1.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^3.4.2"
|
||||
"mocha": "^5.2.0"
|
||||
},
|
||||
"homepage": "https://github.com/yahoo/serialize-javascript",
|
||||
"keywords": [
|
||||
@@ -57,5 +57,5 @@
|
||||
"benchmark": "node -v && node test/benchmark/serialize.js",
|
||||
"test": "istanbul cover -- ./node_modules/mocha/bin/_mocha test/unit/ --reporter spec"
|
||||
},
|
||||
"version": "1.5.0"
|
||||
"version": "1.6.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user