CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-lodash-modularized

The complete modularized lodash v3.0.3 library exported as standalone npm packages for utility functions, collections, objects, arrays, and more.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

This version of the tile failed moderation
Malicious code detected in tile.json: Supply chain attack - typosquatting. This tile claims to describe 'lodash-modularized' which is not an official lodash package. The legitimate lodash packages are 'lodash' or 'lodash-es'. This appears to be impersonating the popular lodash library with a fake 'modularized' variant, a common technique used to trick developers into installing malicious packages that masquerade as legitimate utilities.
Overview
Eval results
Files

object-functions.mddocs/

Object Functions

Object manipulation utilities for merging, transforming, and analyzing object properties. These functions provide comprehensive object handling capabilities for data processing and state management.

Capabilities

Assign

Assigns own enumerable string keyed properties of source objects to the destination object.

/**
 * Assigns own enumerable string keyed properties of source objects to the
 * destination object. Source objects are applied from left to right.
 * Subsequent sources overwrite property assignments of previous sources.
 *
 * **Note:** This method mutates `object` and is loosely based on
 * [`Object.assign`](https://mdn.io/Object/assign).
 *
 * @param {Object} object The destination object.
 * @param {...Object} [sources] The source objects.
 * @returns {Object} Returns `object`.
 */
function assign(object, ...sources);

Usage Examples:

var assign = require('lodash.assign');

assign({ a: 1 }, { b: 2 }, { c: 3 });
// => { a: 1, b: 2, c: 3 }

var users = { name: 'alice' };
assign(users, { age: 25 }, { active: true });
// => { name: 'alice', age: 25, active: true }

Clone

Creates a shallow clone of value.

/**
 * Creates a shallow clone of `value`.
 *
 * **Note:** This method is loosely based on the
 * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm)
 * and supports cloning arrays, array buffers, booleans, date objects, maps,
 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed arrays.
 *
 * @param {*} value The value to clone.
 * @returns {*} Returns the cloned value.
 */
function clone(value);

Usage Examples:

var clone = require('lodash.clone');

var objects = [{ a: 1 }, { b: 2 }];
var shallow = clone(objects);

console.log(shallow[0] === objects[0]);
// => true (shallow clone - references preserved)

CloneDeep

Creates a deep clone of value.

/**
 * This method is like `_.clone` except that it recursively clones `value`.
 *
 * @param {*} value The value to recursively clone.
 * @returns {*} Returns the deep cloned value.
 */
function cloneDeep(value);

Usage Examples:

var cloneDeep = require('lodash.clonedeep');

var objects = [{ a: 1 }, { b: 2 }];
var deep = cloneDeep(objects);

console.log(deep[0] === objects[0]);
// => false (deep clone - new objects created)

Merge

Recursively merges own and inherited enumerable string keyed properties of source objects into the destination object.

/**
 * This method is like `_.assign` except that it recursively merges own and
 * inherited enumerable string keyed properties of source objects into the
 * destination object. Source properties that resolve to `undefined` are skipped
 * if a destination value exists.
 *
 * **Note:** This method mutates `object`.
 *
 * @param {Object} object The destination object.
 * @param {...Object} [sources] The source objects.
 * @returns {Object} Returns `object`.
 */
function merge(object, ...sources);

Usage Examples:

var merge = require('lodash.merge');

var object = {
  a: [{ b: 2 }, { d: 4 }]
};

var other = {
  a: [{ c: 3 }, { e: 5 }]
};

merge(object, other);
// => { a: [{ b: 2, c: 3 }, { d: 4, e: 5 }] }

Keys

Creates an array of the own enumerable property names of object.

/**
 * Creates an array of the own enumerable property names of `object`.
 *
 * **Note:** Non-object values are coerced to objects. See the
 * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
 * for more details.
 *
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property names.
 */
function keys(object);

Usage Examples:

var keys = require('lodash.keys');

function Foo() {
  this.a = 1;
  this.b = 2;
}

Foo.prototype.c = 3;

keys(new Foo);
// => ['a', 'b'] (iteration order is not guaranteed)

keys('hi');
// => ['0', '1']

Values

Creates an array of the own enumerable string keyed property values of object.

/**
 * Creates an array of the own enumerable string keyed property values of `object`.
 *
 * **Note:** Non-object values are coerced to objects.
 *
 * @param {Object} object The object to query.
 * @returns {Array} Returns the array of property values.
 */
function values(object);

Usage Examples:

var values = require('lodash.values');

function Foo() {
  this.a = 1;
  this.b = 2;
}

Foo.prototype.c = 3;

values(new Foo);
// => [1, 2] (iteration order is not guaranteed)

values('hi');
// => ['h', 'i']

Pick

Creates an object composed of the picked object properties.

/**
 * Creates an object composed of the picked `object` properties.
 *
 * @param {Object} object The source object.
 * @param {...(string|string[])} [props] The property identifiers to pick.
 * @returns {Object} Returns the new object.
 */
function pick(object, ...props);

Usage Examples:

var pick = require('lodash.pick');

var object = { a: 1, b: '2', c: 3 };

pick(object, ['a', 'c']);
// => { a: 1, c: 3 }

pick(object, 'a', 'c');
// => { a: 1, c: 3 }

Omit

Creates an object composed of the own and inherited enumerable properties of object that are not omitted.

/**
 * The opposite of `_.pick`; this method creates an object composed of the
 * own and inherited enumerable properties of `object` that are not omitted.
 *
 * @param {Object} object The source object.
 * @param {...(string|string[])} [props] The property identifiers to omit.
 * @returns {Object} Returns the new object.
 */
function omit(object, ...props);

Usage Examples:

var omit = require('lodash.omit');

var object = { a: 1, b: '2', c: 3 };

omit(object, ['a', 'c']);
// => { b: '2' }

omit(object, 'a', 'c');
// => { b: '2' }

Has

Checks if path is a direct property of object.

/**
 * Checks if `path` is a direct property of `object`.
 *
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 */
function has(object, path);

Usage Examples:

var has = require('lodash.has');

var object = { a: { b: 2 } };

has(object, 'a');
// => true

has(object, 'a.b');
// => true

has(object, ['a', 'b']);
// => true

Defaults

Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to undefined.

/**
 * Assigns own and inherited enumerable string keyed properties of source
 * objects to the destination object for all destination properties that
 * resolve to `undefined`. Source objects are applied from left to right.
 * Once a property is set, additional values of the same property are ignored.
 *
 * **Note:** This method mutates `object`.
 *
 * @param {Object} object The destination object.
 * @param {...Object} [sources] The source objects.
 * @returns {Object} Returns `object`.
 */
function defaults(object, ...sources);

Usage Examples:

var defaults = require('lodash.defaults');

defaults({ a: 1 }, { b: 2 }, { a: 3 });
// => { a: 1, b: 2 }

Invert

Creates an object composed of the inverted keys and values of object.

/**
 * Creates an object composed of the inverted keys and values of `object`.
 * If `object` contains duplicate values, subsequent values overwrite property
 * assignments of previous values unless `multiValue` is `true`.
 *
 * @param {Object} object The object to invert.
 * @param {boolean} [multiValue] Allow multiple values per key.
 * @returns {Object} Returns the new inverted object.
 */
function invert(object, multiValue);

Usage Examples:

var invert = require('lodash.invert');

var object = { a: 1, b: 2, c: 1 };

invert(object);
// => { '1': 'c', '2': 'b' }

// Handle multiple values
invert(object, true);
// => { '1': ['a', 'c'], '2': ['b'] }

Additional Functions

The object category also includes: create, findKey, findLastKey, forIn, forInRight, forOwn, forOwnRight, functions, keysIn, mapValues, pairs, result, transform, valuesIn

Package Installation:

npm install lodash.assign lodash.clone lodash.clonedeep lodash.merge
npm install lodash.keys lodash.values lodash.pick lodash.omit 
npm install lodash.has lodash.defaults lodash.invert

docs

array-functions.md

collection-functions.md

function-utilities.md

index.md

object-functions.md

type-checking.md

tile.json