@maptalks/feature-filter
Advanced tools
+7
-1
@@ -40,6 +40,12 @@ /*! | ||
| op === '!has' ? compileNegation(compileHasOp(filter[1])) : | ||
| 'true'; | ||
| op === 'test' ? compileRegex(filter[1], filter[2]) : | ||
| 'true'; | ||
| return `(${str})`; | ||
| } | ||
| function compileRegex(property, regex) { | ||
| const prop = compilePropertyReference(property); | ||
| return `new RegExp("${regex}").test(${prop})`; | ||
| } | ||
| function compilePropertyReference(property) { | ||
@@ -46,0 +52,0 @@ // const ref = |
+4
-4
| { | ||
| "name": "@maptalks/feature-filter", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "main": "./index.js", | ||
| "module": "./index.js", | ||
| "type": "module", | ||
| "description": "Creates filtering function for features", | ||
@@ -12,9 +13,8 @@ "dependencies": {}, | ||
| "eslint-plugin-mocha": "^5.1.0", | ||
| "esm": "^3.0.64", | ||
| "expect.js": "^0.3.1", | ||
| "mocha": "^5.2.0" | ||
| "mocha": "^10.0.0" | ||
| }, | ||
| "scripts": { | ||
| "pretest": "eslint index.js test.js", | ||
| "test": "mocha -r esm test.js" | ||
| "test": "mocha test.js" | ||
| }, | ||
@@ -21,0 +21,0 @@ "repository": { |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
89745
0.31%5
-16.67%1662
0.3%Yes
NaN2
100%