object-rewrite
Advanced tools
Comparing version 10.0.0 to 10.0.1
@@ -1,5 +0,5 @@ | ||
import { injectPlugin, filterPlugin, sortPlugin } from './module/plugin'; | ||
import rewriter from './module/rewriter'; | ||
const { injectPlugin, filterPlugin, sortPlugin } = require('./module/plugin'); | ||
const rewriter = require('./module/rewriter'); | ||
export default { | ||
module.exports = { | ||
injectPlugin, | ||
@@ -6,0 +6,0 @@ filterPlugin, |
@@ -1,6 +0,6 @@ | ||
import assert from 'assert'; | ||
import Joi from 'joi-strict'; | ||
import validationCompile from './plugin/validation-compile'; | ||
import validationExtractKeys from './plugin/validation-extract-keys'; | ||
import joinPath from './plugin/join-path'; | ||
const assert = require('assert'); | ||
const Joi = require('joi-strict'); | ||
const validationCompile = require('./plugin/validation-compile'); | ||
const validationExtractKeys = require('./plugin/validation-extract-keys'); | ||
const joinPath = require('./plugin/join-path'); | ||
@@ -166,4 +166,4 @@ const plugin = (type, options) => { | ||
export const filterPlugin = (opts) => plugin('FILTER', opts); | ||
export const injectPlugin = (opts) => plugin('INJECT', opts); | ||
export const sortPlugin = (opts) => plugin('SORT', opts); | ||
module.exports.filterPlugin = (opts) => plugin('FILTER', opts); | ||
module.exports.injectPlugin = (opts) => plugin('INJECT', opts); | ||
module.exports.sortPlugin = (opts) => plugin('SORT', opts); |
@@ -1,2 +0,2 @@ | ||
export default (input) => { | ||
module.exports = (input) => { | ||
const result = input.filter((e) => !!e).join('.'); | ||
@@ -3,0 +3,0 @@ if (result === '*') { |
@@ -1,2 +0,2 @@ | ||
import assert from 'assert'; | ||
const assert = require('assert'); | ||
@@ -23,2 +23,2 @@ const validationCompile = (input, strict = true) => { | ||
}; | ||
export default validationCompile; | ||
module.exports = validationCompile; |
@@ -1,2 +0,2 @@ | ||
import assert from 'assert'; | ||
const assert = require('assert'); | ||
@@ -18,2 +18,2 @@ const validationExtractKeys = (prefix, input) => { | ||
}; | ||
export default validationExtractKeys; | ||
module.exports = validationExtractKeys; |
@@ -1,10 +0,10 @@ | ||
import assert from 'assert'; | ||
import objectFields from 'object-fields'; | ||
import compileMeta from './rewriter/compile-meta'; | ||
import mkInjectRewriter from './rewriter/mk-inject-rewriter'; | ||
import mkFilterRewriter from './rewriter/mk-filter-rewriter'; | ||
import mkSortRewriter from './rewriter/mk-sort-rewriter'; | ||
import initPluginMap from './rewriter/init-plugin-map'; | ||
const assert = require('assert'); | ||
const objectFields = require('object-fields'); | ||
const compileMeta = require('./rewriter/compile-meta'); | ||
const mkInjectRewriter = require('./rewriter/mk-inject-rewriter'); | ||
const mkFilterRewriter = require('./rewriter/mk-filter-rewriter'); | ||
const mkSortRewriter = require('./rewriter/mk-sort-rewriter'); | ||
const initPluginMap = require('./rewriter/init-plugin-map'); | ||
export default (pluginMap, dataStoreFields_, logger = console) => { | ||
module.exports = (pluginMap, dataStoreFields_, logger = console) => { | ||
assert(pluginMap instanceof Object && !Array.isArray(pluginMap)); | ||
@@ -11,0 +11,0 @@ assert(Array.isArray(dataStoreFields_) && dataStoreFields_.every((e) => typeof e === 'string')); |
@@ -1,2 +0,2 @@ | ||
export default (keys) => { | ||
module.exports = (keys) => { | ||
const lookups = keys.reduce((p, c, idx) => { | ||
@@ -3,0 +3,0 @@ const index = Math.max(0, c.lastIndexOf('.')); |
@@ -1,5 +0,5 @@ | ||
import compileTargetMap from './compile-target-map'; | ||
const compileTargetMap = require('./compile-target-map'); | ||
// todo: write separate test | ||
export default (plugins, fields, initContext, logger) => { | ||
module.exports = (plugins, fields, initContext, logger) => { | ||
const pluginsByType = { | ||
@@ -6,0 +6,0 @@ FILTER: [], |
@@ -1,2 +0,2 @@ | ||
export default (type, plugins, initContext) => { | ||
module.exports = (type, plugins, initContext) => { | ||
const result = {}; | ||
@@ -3,0 +3,0 @@ for (let i = 0; i < plugins.length; i += 1) { |
@@ -1,2 +0,2 @@ | ||
export default (map, data, context, logger) => { | ||
module.exports = (map, data, context, logger) => { | ||
const result = {}; | ||
@@ -3,0 +3,0 @@ const activeLookup = new Map(); |
@@ -1,6 +0,6 @@ | ||
import assert from 'assert'; | ||
import objectScan from 'object-scan'; | ||
import CompareFn from './compare-fn'; | ||
const assert = require('assert'); | ||
const objectScan = require('object-scan'); | ||
const CompareFn = require('./compare-fn'); | ||
export default (keys) => objectScan(keys, { | ||
module.exports = (keys) => objectScan(keys, { | ||
useArraySelector: false, | ||
@@ -7,0 +7,0 @@ compareFn: CompareFn(keys), |
@@ -1,7 +0,7 @@ | ||
import assert from 'assert'; | ||
import objectScan from 'object-scan'; | ||
import set from 'lodash.set'; | ||
import CompareFn from './compare-fn'; | ||
const assert = require('assert'); | ||
const objectScan = require('object-scan'); | ||
const set = require('lodash.set'); | ||
const CompareFn = require('./compare-fn'); | ||
export default (keys) => objectScan(keys, { | ||
module.exports = (keys) => objectScan(keys, { | ||
useArraySelector: false, | ||
@@ -8,0 +8,0 @@ compareFn: CompareFn(keys), |
@@ -1,7 +0,7 @@ | ||
import assert from 'assert'; | ||
import objectScan from 'object-scan'; | ||
import cmpFn from '../../util/cmp-fn'; | ||
import CompareFn from './compare-fn'; | ||
const assert = require('assert'); | ||
const objectScan = require('object-scan'); | ||
const cmpFn = require('../../util/cmp-fn'); | ||
const CompareFn = require('./compare-fn'); | ||
export default (keys) => objectScan(keys, { | ||
module.exports = (keys) => objectScan(keys, { | ||
useArraySelector: false, | ||
@@ -8,0 +8,0 @@ compareFn: CompareFn(keys), |
@@ -1,2 +0,2 @@ | ||
import assert from 'assert'; | ||
const assert = require('assert'); | ||
@@ -20,2 +20,2 @@ const fn = (a, b) => { | ||
}; | ||
export default fn; | ||
module.exports = fn; |
{ | ||
"name": "object-rewrite", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"description": "Rewrite Object(s) in place using plugins.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -128,3 +128,3 @@ # object-rewrite | ||
```js | ||
import { injectPlugin, rewriter } from 'object-rewrite'; | ||
const { injectPlugin, rewriter } = require('object-rewrite'); | ||
@@ -131,0 +131,0 @@ const plugin = injectPlugin(/* ... */); |
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
29239