Comparing version 0.1.0 to 0.1.1
@@ -15,2 +15,3 @@ 'use strict'; | ||
const FN_DECLARATION_REGEXP = /(?:function\s*)?\(([^)]+)\)\s*(?:=>)?\s*{?/; | ||
class Fallback { | ||
@@ -37,6 +38,6 @@ #modules = new Set(); | ||
this.extraCode = Reflect.apply(Function.toString, fn, []).replace(/\(([^)]+)\)/, (_, args) => { | ||
this.extraCode = Reflect.apply(Function.toString, fn, []).replace(FN_DECLARATION_REGEXP, (_, args) => { | ||
const arr = args.split(/[,\s]+/); | ||
arr.length = 3; | ||
return `(${arr.join(', ')})`; | ||
return `(${arr.join(', ')}) => {`; | ||
}); | ||
@@ -52,5 +53,5 @@ } | ||
const args = Array.from(this.#deps.keys()); | ||
tree.push(builders.variableDeclaration('const', [builders.variableDeclarator(id, builders.callExpression(builders.callExpression(builders.identifier('Function'), [...args.map(builders.stringLiteral), builders.templateLiteral([builders.templateElement({ | ||
tree.push(builders.variableDeclaration('const', [builders.variableDeclarator(id, builders.callExpression(builders.memberExpression(builders.callExpression(builders.identifier('Function'), [builders.templateLiteral([builders.templateElement({ | ||
raw: `return ${this.extraCode}` | ||
})], [])]), args.map(safeIdentifier)))]), 'program'); | ||
})], [])]), builders.identifier('call')), [builders.objectExpression(args.map(arg => builders.objectProperty(builders.stringLiteral(arg), safeIdentifier(arg))))]))]), 'program'); | ||
return id; | ||
@@ -57,0 +58,0 @@ } |
@@ -24,6 +24,6 @@ 'use strict'; | ||
}] | ||
}, function (input, path, fn, JSONPath, toPath) { | ||
JSONPath({ | ||
}, function (input, path, fn) { | ||
this.JSONPath({ | ||
callback: result => void fn({ | ||
path: toPath(result.path.slice(1)), | ||
path: this.toPath(result.path.slice(1)), | ||
value: result.value | ||
@@ -30,0 +30,0 @@ }), |
@@ -16,2 +16,4 @@ 'use strict'; | ||
const FN_DECLARATION_REGEXP = /(?:function\s*)?\(([^)]+)\)\s*(?:=>)?\s*{?/; | ||
var _modules = /*#__PURE__*/new WeakMap(); | ||
@@ -52,6 +54,6 @@ | ||
this.extraCode = Reflect.apply(Function.toString, fn, []).replace(/\(([^)]+)\)/, (_, args) => { | ||
this.extraCode = Reflect.apply(Function.toString, fn, []).replace(FN_DECLARATION_REGEXP, (_, args) => { | ||
const arr = args.split(/[,\s]+/); | ||
arr.length = 3; | ||
return `(${arr.join(', ')})`; | ||
return `(${arr.join(', ')}) => {`; | ||
}); | ||
@@ -67,5 +69,5 @@ } | ||
const args = Array.from(_rollupPluginBabelHelpers.classPrivateFieldGet(this, _deps).keys()); | ||
tree.push(builders.variableDeclaration('const', [builders.variableDeclarator(id, builders.callExpression(builders.callExpression(builders.identifier('Function'), [...args.map(builders.stringLiteral), builders.templateLiteral([builders.templateElement({ | ||
tree.push(builders.variableDeclaration('const', [builders.variableDeclarator(id, builders.callExpression(builders.memberExpression(builders.callExpression(builders.identifier('Function'), [builders.templateLiteral([builders.templateElement({ | ||
raw: `return ${this.extraCode}` | ||
})], [])]), args.map(safeIdentifier)))]), 'program'); | ||
})], [])]), builders.identifier('call')), [builders.objectExpression(args.map(arg => builders.objectProperty(builders.stringLiteral(arg), safeIdentifier(arg))))]))]), 'program'); | ||
return id; | ||
@@ -72,0 +74,0 @@ } |
@@ -24,6 +24,6 @@ 'use strict'; | ||
}] | ||
}, function (input, path, fn, JSONPath, toPath) { | ||
JSONPath({ | ||
}, function (input, path, fn) { | ||
this.JSONPath({ | ||
callback: result => void fn({ | ||
path: toPath(result.path.slice(1)), | ||
path: this.toPath(result.path.slice(1)), | ||
value: result.value | ||
@@ -30,0 +30,0 @@ }), |
{ | ||
"name": "nimma", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "JSONPath engine that scales.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
581239
193
18119
8