object-rewrite
Advanced tools
Comparing version 10.0.9 to 10.1.0
@@ -24,2 +24,3 @@ import Joi from 'joi-strict'; | ||
onRewrite: Joi.function().optional(), | ||
beforeFn: Joi.function().optional(), | ||
fn: Joi.function(), | ||
@@ -30,3 +31,3 @@ limit: type === 'SORT' ? Joi.function().optional() : Joi.forbidden() | ||
const { | ||
name, target, requires, schema, onInit, onRewrite, fn, limit | ||
name, target, requires, schema, onInit, onRewrite, beforeFn, fn, limit | ||
} = options; | ||
@@ -108,2 +109,3 @@ | ||
type, | ||
beforeFn: wrap(beforeFn), | ||
fn: fnWrapped, | ||
@@ -110,0 +112,0 @@ limit: wrap(limit) |
@@ -36,2 +36,5 @@ import objectScan from 'object-scan'; | ||
}; | ||
if (typeof plugin.beforeFn === 'function') { | ||
plugin.beforeFn(kwargs); | ||
} | ||
if (plugin.self.meta.isAsync) { | ||
@@ -38,0 +41,0 @@ promises.push(async () => { |
{ | ||
"name": "object-rewrite", | ||
"type": "module", | ||
"version": "10.0.9", | ||
"version": "10.1.0", | ||
"description": "Rewrite Object(s) in place using plugins.", | ||
@@ -14,20 +14,19 @@ "main": "lib/index.js", | ||
"object-fields": "3.0.1", | ||
"object-scan": "18.3.3" | ||
"object-scan": "18.5.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.18.5", | ||
"@babel/eslint-parser": "7.18.2", | ||
"@babel/register": "7.17.7", | ||
"@blackflux/eslint-plugin-rules": "2.1.0", | ||
"@blackflux/robo-config-plugin": "7.8.8", | ||
"c8": "7.11.3", | ||
"chai": "4.3.6", | ||
"coveralls": "3.1.1", | ||
"eslint": "8.18.0", | ||
"@babel/core": "7.22.1", | ||
"@babel/eslint-parser": "7.21.8", | ||
"@babel/register": "7.21.0", | ||
"@blackflux/eslint-plugin-rules": "2.2.0", | ||
"@blackflux/robo-config-plugin": "7.9.20", | ||
"c8": "7.14.0", | ||
"chai": "4.3.7", | ||
"eslint": "8.41.0", | ||
"eslint-config-airbnb-base": "15.0.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"eslint-plugin-import": "2.27.5", | ||
"eslint-plugin-json": "3.1.0", | ||
"eslint-plugin-markdown": "2.2.1", | ||
"eslint-plugin-mocha": "10.0.5", | ||
"js-gardener": "3.0.5", | ||
"eslint-plugin-markdown": "3.0.0", | ||
"eslint-plugin-mocha": "10.1.0", | ||
"js-gardener": "4.0.2", | ||
"lodash.get": "4.4.2", | ||
@@ -43,3 +42,2 @@ "lodash.shuffle": "4.2.0", | ||
"test": "yarn run clean && yarn run gardener && yarn run test-simple", | ||
"coveralls": "node ./node_modules/coveralls/bin/coveralls.js < ./coverage/lcov.info", | ||
"semantic-release": "yarn run build-clean && npx semantic-release", | ||
@@ -46,0 +44,0 @@ "gardener": "node gardener.js", |
@@ -73,2 +73,3 @@ # object-rewrite | ||
- `required` _Array_: required fields relative to the plugin path. Can specify relative to root by prefixing with `/`. Will influence `fieldsToRequest`. Can be specified as function that takes `initContext` and expected to return array. | ||
- `beforeFn` _Function_: executed before any fn execution happens for plugin type | ||
- `fn` _Function_: result of this function is used by the plugin. Signature is `fn({ key, value, parents, context, cache })`. | ||
@@ -75,0 +76,0 @@ - `onInit({ context, cache })` _Function_ (optional): if present called once per init, used to initialize cache, if returns other than `true`, the plugin is disabled |
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
29163
17
575
181
+ Addedobject-scan@18.5.1(transitive)
- Removedobject-scan@18.3.3(transitive)
Updatedobject-scan@18.5.1