object-scan
Advanced tools
Comparing version 14.2.1 to 14.3.0
@@ -7,3 +7,3 @@ "use strict"; | ||
onMatch: () => {}, | ||
finish: () => ctx.context | ||
get: () => ctx.context | ||
}; | ||
@@ -18,3 +18,3 @@ } | ||
}, | ||
finish: () => result | ||
get: () => result | ||
}; | ||
@@ -29,3 +29,3 @@ } | ||
}, | ||
finish: () => result | ||
get: () => result | ||
}; | ||
@@ -37,4 +37,4 @@ } | ||
onMatch: Array.isArray(ctx.rtn) ? () => result.push(ctx.rtn.map(rtn => kwargs[rtn])) : () => result.push(kwargs[ctx.rtn]), | ||
finish: () => ctx.abort ? result[0] : result | ||
get: () => ctx.abort ? result[0] : result | ||
}; | ||
}; |
@@ -103,2 +103,7 @@ "use strict"; | ||
/* getResult: <defined-below> */ | ||
get result() { | ||
return kwargs.getResult(); | ||
}, | ||
context: ctx.context | ||
@@ -108,2 +113,4 @@ }; | ||
kwargs.getResult = () => result.get(); | ||
do { | ||
@@ -137,3 +144,3 @@ depth = stack.pop(); | ||
if (ctx.abort) { | ||
return result.finish(); | ||
return result.get(); | ||
} | ||
@@ -216,3 +223,3 @@ } // eslint-disable-next-line no-continue | ||
return result.finish(); | ||
return result.get(); | ||
}; |
{ | ||
"name": "object-scan", | ||
"version": "14.2.1", | ||
"version": "14.3.0", | ||
"description": "Traverse object hierarchies using matching and callbacks.", | ||
@@ -50,3 +50,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@babel/cli": "7.13.14", | ||
"@babel/cli": "7.13.16", | ||
"@babel/core": "7.13.16", | ||
@@ -53,0 +53,0 @@ "@babel/register": "7.13.16", |
@@ -332,2 +332,3 @@ # Object-Scan | ||
- `depth`: length of `key` | ||
- `result`: intermittent result as defined by `rtn` | ||
- `getKey`: function that returns `key` | ||
@@ -346,2 +347,3 @@ - `getValue`: function that returns `value` | ||
- `getDepth`: function that returns `depth` | ||
- `getResult`: function that returns `result` | ||
- `context`: as passed into the search | ||
@@ -348,0 +350,0 @@ |
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
58216
836
937