object-rewrite
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -1,6 +0,6 @@ | ||
const assert = require("assert"); | ||
const assert = require('assert'); | ||
const objectScan = require("object-scan"); | ||
const objectScan = require('object-scan'); | ||
const tree = require("./util/tree"); | ||
const tree = require('./util/tree'); | ||
@@ -11,3 +11,3 @@ module.exports = ({ | ||
overwrite = {}, | ||
retain = ["**"], | ||
retain = ['**'], | ||
retainEmptyParents = true | ||
@@ -41,3 +41,3 @@ }) => { | ||
if (overwrite[needle] !== undefined) { | ||
const lastStringIndex = key.reduce((p, c, idx) => typeof c === "string" ? idx : p, 0); | ||
const lastStringIndex = key.reduce((p, c, idx) => typeof c === 'string' ? idx : p, 0); | ||
const directParent = key.slice(lastStringIndex, -1).reduce((p, c) => p[c], parents[0]); // eslint-disable-next-line no-param-reassign | ||
@@ -72,2 +72,2 @@ | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJhc3NlcnQiLCJyZXF1aXJlIiwib2JqZWN0U2NhbiIsInRyZWUiLCJtb2R1bGUiLCJleHBvcnRzIiwiZmlsdGVyIiwiaW5qZWN0Iiwib3ZlcndyaXRlIiwicmV0YWluIiwicmV0YWluRW1wdHlQYXJlbnRzIiwibmVlZGxlcyIsIk9iamVjdCIsImtleXMiLCJ0b1JlbW92ZSIsInRvUmV0YWluIiwic2Nhbm5lciIsInVzZUFycmF5U2VsZWN0b3IiLCJqb2luZWQiLCJjYWxsYmFja0ZuIiwia2V5IiwidmFsdWUiLCJpc01hdGNoIiwibmVlZGxlIiwicGFyZW50cyIsInVuZGVmaW5lZCIsInB1c2giLCJpbmNsdWRlcyIsImFzc2lnbiIsImxhc3RTdHJpbmdJbmRleCIsInJlZHVjZSIsInAiLCJjIiwiaWR4IiwiZGlyZWN0UGFyZW50Iiwic2xpY2UiLCJhcnJheUNhbGxiYWNrRm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jYW5uZXIoaW5wdXQpO1xuICAgIHRyZWUucHJ1bmUoaW5wdXQsIHRvUmVtb3ZlLCB0b1JldGFpbik7XG4gICAgdG9SZW1vdmUubGVuZ3RoID0gMDtcbiAgICB0b1JldGFpbi5sZW5ndGggPSAwO1xuICB9O1xufTtcbiJdfQ== |
@@ -1,2 +0,2 @@ | ||
const LEAF = Symbol("leaf"); | ||
const LEAF = Symbol('leaf'); | ||
@@ -56,2 +56,2 @@ const markLeaf = input => Object.defineProperty(input, LEAF, { | ||
}; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3RyZWUuanMiXSwibmFtZXMiOlsiTEVBRiIsIlN5bWJvbCIsIm1hcmtMZWFmIiwiaW5wdXQiLCJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsInZhbHVlIiwid3JpdGFibGUiLCJpc0xlYWYiLCJtb2R1bGUiLCJleHBvcnRzIiwiYnVpbGQiLCJuZWVkbGVzIiwicmVzdWx0IiwiZm9yRWFjaCIsImJyYW5jaCIsImVsZSIsInNlZyIsInVuZGVmaW5lZCIsInBydW5lUmVjIiwicmVtb3ZlIiwicmV0YWluIiwiaXNBcnJheSIsIkFycmF5IiwiaW5wdXRFbnRyaWVzIiwiZW50cmllcyIsInNvcnQiLCJhIiwiYiIsInBhcnNlSW50Iiwia2V5Iiwic3BsaWNlIiwicHJ1bmUiXSwibWFwcGluZ3MiOiJBQUFBLE1BQU1BLE9BQU9DLE9BQU8sTUFBUCxDQUFiOztBQUVBLE1BQU1DLFdBQVdDLFNBQVNDLE9BQU9DLGNBQVAsQ0FBc0JGLEtBQXRCLEVBQTZCSCxJQUE3QixFQUFtQztBQUFFTSxTQUFPLElBQVQ7QUFBZUMsWUFBVTtBQUF6QixDQUFuQyxDQUExQjs7QUFDQSxNQUFNQyxTQUFTTCxTQUFTQSxNQUFNSCxJQUFOLE1BQWdCLElBQXhDOzt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dXQpO1xuICBjb25zdCBpbnB1dEVudHJpZXMgPSBPYmplY3QuZW50cmllcyhpbnB1dCk7XG4gIGlmIChpc0FycmF5KSB7XG4gICAgLy8gc29ydCBpbnZlcnNlIHNvIGFycmF5IGRlbGV0ZSBtYXRjaGVzIGNvcnJlY3QgaW5kZXhcbiAgICBpbnB1dEVudHJpZXMuc29ydCgoYSwgYikgPT4gcGFyc2VJbnQoYlswXSwgMTApIC0gcGFyc2VJbnQoYVswXSwgMTApKTtcbiAgfVxuICBpbnB1dEVudHJpZXMuZm9yRWFjaCgoW2tleSwgdmFsdWVdKSA9PiB7XG4gICAgaWYgKFxuICAgICAgKHJlbW92ZVtrZXldICE9PSB1bmRlZmluZWQgJiYgaXNMZWFmKHJlbW92ZVtrZXldKSlcbiAgICAgIHx8IChyZXRhaW5ba2V5XSA9PT0gdW5kZWZpbmVkKVxuICAgICkge1xuICAgICAgaWYgKGlzQXJyYXkpIHtcbiAgICAgICAgaW5wdXQuc3BsaWNlKGtleSwgMSk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tcGFyYW0tcmVhc3NpZ25cbiAgICAgICAgZGVsZXRlIGlucHV0W2tleV07XG4gICAgICB9XG4gICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIE9iamVjdCkge1xuICAgICAgcHJ1bmVSZWModmFsdWUsIHJlbW92ZVtrZXldIHx8IHt9LCByZXRhaW5ba2V5XSk7XG4gICAgfVxuICB9KTtcbn07XG5cbm1vZHVsZS5leHBvcnRzLnBydW5lID0gKGlucHV0LCByZW1vdmUsIHJldGFpbikgPT4ge1xuICBwcnVuZVJlYyhpbnB1dCwgYnVpbGQocmVtb3ZlKSwgYnVpbGQocmV0YWluKSk7XG59O1xuIl19 |
{ | ||
"name": "object-rewrite", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Rewrite an Object", | ||
@@ -10,15 +10,17 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"object-scan": "2.0.3" | ||
"object-scan": "2.1.1" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "7.0.0-beta.3", | ||
"babel-eslint": "10.0.1", | ||
"babel-plugin-transform-flow-comments": "7.0.0-beta.3", | ||
"babel-preset-flow": "7.0.0-beta.3", | ||
"babel-register": "7.0.0-beta.3", | ||
"chai": "4.2.0", | ||
"coveralls": "3.0.2", | ||
"js-gardener": "1.31.8", | ||
"js-gardener": "1.34.2", | ||
"nyc": "13.1.0", | ||
"semantic-release": "15.10.3" | ||
"semantic-release": "15.13.3", | ||
"@babel/register": "7.0.0", | ||
"@babel/core": "7.2.2", | ||
"@babel/cli": "7.2.3", | ||
"@babel/plugin-transform-flow-comments": "7.2.0", | ||
"@babel/plugin-proposal-object-rest-spread": "7.3.1", | ||
"@babel/preset-flow": "7.0.0" | ||
}, | ||
@@ -63,3 +65,3 @@ "scripts": { | ||
"require": [ | ||
"babel-register" | ||
"@babel/register" | ||
], | ||
@@ -66,0 +68,0 @@ "extension": [], |
@@ -26,18 +26,18 @@ [![Build Status](https://circleci.com/gh/blackflux/object-rewrite.png?style=shield)](https://circleci.com/gh/blackflux/object-rewrite) | ||
```js | ||
const objectRewrite = require("object-rewrite"); | ||
const objectRewrite = require('object-rewrite'); | ||
const data = [{ | ||
guid: "aad8b948-a3de-4bff-a50f-3d59e9510aa9", | ||
guid: 'aad8b948-a3de-4bff-a50f-3d59e9510aa9', | ||
count: 3, | ||
active: "yes", | ||
active: 'yes', | ||
tags: [{ id: 1 }, { id: 2 }, { id: 3 }] | ||
}, { | ||
guid: "4409fb72-36e3-4385-b3da-b4944d028dcb", | ||
guid: '4409fb72-36e3-4385-b3da-b4944d028dcb', | ||
count: 4, | ||
active: "yes", | ||
active: 'yes', | ||
tags: [{ id: 2 }, { id: 3 }, { id: 4 }] | ||
}, { | ||
guid: "96067a3c-caa2-4018-bcec-6969a874dad9", | ||
guid: '96067a3c-caa2-4018-bcec-6969a874dad9', | ||
count: 5, | ||
active: "no", | ||
active: 'no', | ||
tags: [{ id: 3 }, { id: 4 }, { id: 5 }] | ||
@@ -48,12 +48,12 @@ }]; | ||
filter: { | ||
"": (key, value, parents) => value.active === "yes", | ||
'': (key, value, parents) => value.active === 'yes', | ||
tags: (key, value, parents) => value.id === 4 | ||
}, | ||
inject: { | ||
"": (key, value, parents) => ({ countNext: value.count + 1 }) | ||
'': (key, value, parents) => ({ countNext: value.count + 1 }) | ||
}, | ||
overwrite: { | ||
active: (key, value) => value === "yes" | ||
active: (key, value) => value === 'yes' | ||
}, | ||
retain: ["count", "countNext", "active", "tags.id"] | ||
retain: ['count', 'countNext', 'active', 'tags.id'] | ||
}); | ||
@@ -60,0 +60,0 @@ |
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
22084
12
+ Addedobject-scan@2.1.1(transitive)
- Removedobject-scan@2.0.3(transitive)
Updatedobject-scan@2.1.1