Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { omit as _omit } from 'lodash'
import { apply } from 'immutadot/core'
/**
* Replaces by an object omitting specified properties.
* @function
* @memberof object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {...(string|string[])} [paths] The property paths to omit.
* @return {Object} Returns the updated object.
* @example omit({ nested: { a: 1, b: 2, c: 3 } }, 'nested', 'b') // => { nested: { a:1, c: 3 } }
* @see {@link https://lodash.com/docs#omit|lodash.omit} for more information.
* @since 1.0.0
*/
const omit = apply(_omit, { arity: 1 })
export { omit }
import { drop as _drop } from 'lodash'
import { apply } from 'immutadot/core'
/**
* Replaces an array dropping one or several elements at the start of the former array.
* @function
* @memberof array
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {number} [n=1] The number of elements to drop.
* @return {Object} Returns the updated object.
* @example drop({ nested: { prop: [1, 2, 3, 4] } }, 'nested.prop', 2) // => { nested: { prop: [3, 4] } }
* @see {@link https://lodash.com/docs#drop|lodash.drop} for more information.
* @since 1.0.0
*/
const drop = apply(_drop, { arity: 1 })
export { drop }
import { capitalize as _capitalize } from 'lodash'
import { apply } from 'immutadot/core'
/**
* Converts the first character of string to upper case and the remaining to lower case.
* @function
* @memberof string
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @return {Object} Returns the updated object.
* @example capitalize({ nested: { a: "a string" } }, 'nested.a') // => { nested: { a: "A string" } }
* @see {@link https://lodash.com/docs#capitalize|lodash.capitalize} for more information.
* @since 1.0.0
*/
const capitalize = apply(
_capitalize,
{
arity: 1,
fixedArity: true,
},
)
export { capitalize }
import { apply } from 'immutadot/core'
/**
* This method is like {@link array.difference} except that it uses <code>iteratee</code> to generate the value to be compared for each element.
* @function
* @memberof array
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {...Array} values The arrays of values to exclude.
* @param {Function} [iteratee={@link https://lodash.com/docs#identity|lodash.identity}] The iteratee invoked per element.
* @return {Object} Returns the updated object.
* @example differenceBy({ nested: { prop: [1.2, 3.4, 5.6] } }, 'nested.prop', [5.4, 2.1], Math.floor) // => { nested: { prop: [1.2, 3.4] } }
* @see {@link https://lodash.com/docs#differenceBy|lodash.differenceBy} for more information.
* @since 1.0.0
*/
const differenceBy = apply(_differenceBy, { arity: 2 })
export { differenceBy }
import { omitBy as _omitBy } from 'lodash'
import { apply } from 'immutadot/core'
/**
* Replaces by an object omitting properties that <code>predicate</code> doesn't return truthy for.
* @function
* @memberof object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {function} [predicate={@link https://lodash.com/docs#identity|lodash.identity}] The function invoked per property.
* @return {Object} Returns the updated object.
* @example omitBy({ nested: { a: 1, b: 2, c: 3 } }, 'nested', v => v === 2) // => { nested: { a:1, c: 3 } }
* @see {@link https://lodash.com/docs#omitBy|lodash.omitBy} for more information.
* @since 1.0.0
*/
const omitBy = apply(_omitBy, { arity: 1 })
export { omitBy }
import { apply } from 'immutadot/core'
/**
* This method is like {@link array.union} except that it accepts <code>iteratee</code> to generate the criterion by which elements are compared.
* @function
* @memberof array
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {...Array} [arrays] The arrays to inspect.
* @param {Function} [iteratee={@link https://lodash.com/docs#identity|lodash.identity}] The iteratee invoked per element.
* @return {Object} Returns the updated object.
* @example unionBy({ nested: { prop: [{ x: 1 }, { x: 2 }] } }, 'nested.prop', [{ x: 2 }, { x: 3 }], 'x') // => { nested: { prop: [{ x: 1 }, { x: 2 }, { x: 3 }] } }
* @see {@link https://lodash.com/docs#unionBy|lodash.unionBy} for more information.
* @since 1.0.0
*/
const unionBy = apply(_unionBy, { arity: 2 })
export { unionBy }
import { difference as _difference } from 'lodash'
import { apply } from 'immutadot/core'
/**
* Replaces an array removing values in the other given arrays from the former array.
* @function
* @memberof array
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {...Array} values The arrays of values to exclude.
* @return {Object} Returns the updated object.
* @example difference({ nested: { prop: [1, 2] } }, 'nested.prop', [2, 3]) // => { nested: { prop: [1] } }
* @see {@link https://lodash.com/docs#difference|lodash.difference} for more information.
* @since 1.0.0
*/
const difference = apply(_difference, { arity: 2 })
export { difference }
/**
* Creates a slice of array with elements taken from the end.
* Elements are taken until predicate returns falsey.
* The predicate is invoked with three arguments: (value, index, array).
* @function
* @memberof array
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {Function} [predicate={@link https://lodash.com/docs#identity|lodash.identity}] The function invoked per iteration.
* @return {Object} Returns the updated object.
* @example takeRightWhile({ nested: { prop: [1, 2, 3, 4] } }, 'nested.prop', v => v > 3) // => { nested: { prop: [4] } }
* @see {@link https://lodash.com/docs#takeRightWhile|lodash.takeRightWhile} for more information.
* @since 1.0.0
*/
const takeRightWhile = apply(_takeRightWhile, { arity: 1 })
export { takeRightWhile }
import { apply } from 'immutadot/core'
/**
* Replaces by an object with the same values as the former object and values generated by running each own enumerable string keyed property of the former object thru <code>iteratee</code>.
* The iteratee is invoked with three arguments: (value, key, object).
* @function
* @memberof object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {function} [iteratee={@link https://lodash.com/docs#identity|lodash.identity}] The function invoked per iteration.
* @return {Object} Returns the updated object.
* @example mapKeys({ nested: { a: 1, b: 2, c: 3 } }, 'nested', (v, k) => '_' + k) // => { nested: { _a: 1, _b: 2, _c: 3 } }
* @see {@link https://lodash.com/docs#mapKeys|lodash.mapKeys} for more information.
* @since 1.0.0
*/
const mapKeys = apply(_mapKeys, { arity: 1 })
export { mapKeys }
import { shuffle as _shuffle } from 'lodash'
import { apply } from 'immutadot/core'
/**
* Replaces by an array of shuffled elements.
* @function
* @memberof collection
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @return {Object} Returns the updated object.
* @see {@link https://lodash.com/docs#shuffle|lodash.shuffle} for more information.
* @example shuffle({ nested: { prop: [1, 2, 3, 4, 5, 6, 7, 8, 9] } }, 'nested.prop') // => { nested: { prop: [7, 3, 9, 1, 4, 5, 6, 8, 2] } }
* @since 1.0.0
*/
const shuffle = apply(
_shuffle,
{
arity: 1,
fixedArity: true,
},
)
export { shuffle }