Comparing version 5.1.0 to 5.1.1
@@ -1,2 +0,2 @@ | ||
interface Options { | ||
export interface Options { | ||
allowRegExp: boolean; | ||
@@ -12,2 +12,3 @@ allowFunction: boolean; | ||
} | ||
export declare const isJSON: (input: string) => RegExpMatchArray | null; | ||
export declare const replacer: (options: Options) => (this: any, key: string, value: any) => any; | ||
@@ -19,5 +20,4 @@ interface ValueContainer { | ||
export declare const reviver: (options: Options) => (this: any, key: string, value: ValueContainer | string) => any; | ||
export declare const isJSON: (input: string) => RegExpMatchArray | null; | ||
export declare const stringify: (data: any, options?: Partial<Options>) => string; | ||
export declare const parse: (data: string, options?: Partial<Options>) => any; | ||
export {}; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.parse = exports.stringify = exports.isJSON = exports.reviver = exports.replacer = void 0; | ||
exports.parse = exports.stringify = exports.reviver = exports.replacer = exports.isJSON = void 0; | ||
@@ -41,2 +41,3 @@ var _isRegex = _interopRequireDefault(require("is-regex")); | ||
// eslint-disable-next-line @typescript-eslint/ban-types, no-use-before-define | ||
var isObject = _isobject["default"]; | ||
@@ -118,2 +119,9 @@ | ||
// eslint-disable-next-line no-useless-escape | ||
var isJSON = function isJSON(input) { | ||
return input.match(/^[\[\{\"\}].*[\]\}\"]$/); | ||
}; | ||
exports.isJSON = isJSON; | ||
var replacer = function replacer(options) { | ||
@@ -300,7 +308,10 @@ var objects; | ||
_name = _ref3[1], | ||
source = _ref3[2]; | ||
source = _ref3[2]; // eslint-disable-next-line no-useless-escape | ||
var sourceSanitized = source.replace(/[(\(\))|\\| |\]|`]*$/, ''); | ||
if (!options.lazyEval) { | ||
// eslint-disable-next-line no-eval | ||
return eval("(".concat(source, ")")); | ||
return eval("(".concat(sourceSanitized, ")")); | ||
} // lazy eval of the function | ||
@@ -311,3 +322,3 @@ | ||
// eslint-disable-next-line no-eval | ||
var f = eval("(".concat(source, ")")); | ||
var f = eval("(".concat(sourceSanitized, ")")); | ||
return f.apply(void 0, arguments); | ||
@@ -318,3 +329,3 @@ }; | ||
value: function value() { | ||
return source; | ||
return sourceSanitized; | ||
} | ||
@@ -369,12 +380,5 @@ }); | ||
}; | ||
}; // eslint-disable-next-line no-useless-escape | ||
}; | ||
exports.reviver = reviver; | ||
var isJSON = function isJSON(input) { | ||
return input.match(/^[\[\{\"\}].*[\]\}\"]$/); | ||
}; | ||
exports.isJSON = isJSON; | ||
var defaultOptions = { | ||
@@ -381,0 +385,0 @@ maxDepth: 10, |
{ | ||
"name": "telejson", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "", | ||
@@ -47,24 +47,24 @@ "keywords": [ | ||
"is-function": "^1.0.2", | ||
"is-regex": "^1.1.1", | ||
"is-regex": "^1.1.2", | ||
"is-symbol": "^1.0.3", | ||
"isobject": "^4.0.0", | ||
"lodash": "^4.17.20", | ||
"lodash": "^4.17.21", | ||
"memoizerific": "^1.11.3" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.12.1", | ||
"@babel/core": "^7.12.3", | ||
"@babel/preset-env": "^7.12.1", | ||
"@babel/preset-typescript": "^7.12.1", | ||
"@storybook/eslint-config-storybook": "^2.4.0", | ||
"@types/jest": "^26.0.15", | ||
"@types/lodash": "^4.14.165", | ||
"@babel/cli": "^7.13.14", | ||
"@babel/core": "^7.13.14", | ||
"@babel/preset-env": "^7.13.12", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@storybook/eslint-config-storybook": "^3.0.0", | ||
"@types/jest": "^26.0.22", | ||
"@types/lodash": "^4.14.168", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-jest": "^26.6.3", | ||
"common-tags": "^1.8.0", | ||
"eslint": "^7.13.0", | ||
"eslint": "^7.23.0", | ||
"jest": "^26.6.3", | ||
"prettier": "^2.1.2", | ||
"prettier": "^2.2.1", | ||
"regenerator-runtime": "^0.13.7", | ||
"typescript": "^4.0.5" | ||
"typescript": "^4.2.3" | ||
}, | ||
@@ -71,0 +71,0 @@ "publishConfig": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21042
367
Updatedis-regex@^1.1.2
Updatedlodash@^4.17.21