mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Add related function for each module. [closes #2932]
This commit is contained in:
committed by
John-David Dalton
parent
b856263af6
commit
401016d260
@@ -8,6 +8,7 @@ import createCompounder from './.internal/createCompounder.js';
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to convert.
|
||||
* @returns {string} Returns the camel cased string.
|
||||
* @see upperCase, lowerCase, upperFirst, kebabCase, snakeCase, startCase
|
||||
* @example
|
||||
*
|
||||
* camelCase('Foo Bar');
|
||||
|
||||
@@ -15,7 +15,7 @@ import isArrayLikeObject from './isArrayLikeObject.js';
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {...Array} [values] The values to exclude.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @see without, xor
|
||||
* @see without, xor, xorBy, xorWith, union, unionBy, unionWith
|
||||
* @example
|
||||
*
|
||||
* difference([2, 1], [2, 3]);
|
||||
|
||||
@@ -13,6 +13,7 @@ import toString from './toString.js';
|
||||
* @param {number} [position=string.length] The position to search up to.
|
||||
* @returns {boolean} Returns `true` if `string` ends with `target`,
|
||||
* else `false`.
|
||||
* @see includes, startsWith
|
||||
* @example
|
||||
*
|
||||
* endsWith('abc', 'c');
|
||||
|
||||
@@ -34,6 +34,7 @@ const reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to escape.
|
||||
* @returns {string} Returns the escaped string.
|
||||
* @see unescape, escapeRegExp
|
||||
* @example
|
||||
*
|
||||
* escape('fred, barney, & pebbles');
|
||||
|
||||
@@ -15,6 +15,7 @@ const reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to escape.
|
||||
* @returns {string} Returns the escaped string.
|
||||
* @see unescape, escape, escapeRegExp
|
||||
* @example
|
||||
*
|
||||
* escapeRegExp('[lodash](https://lodash.com/)');
|
||||
|
||||
@@ -13,7 +13,7 @@ import baseFilter from './.internal/baseFilter.js';
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @see reject
|
||||
* @see pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, reject
|
||||
* @example
|
||||
*
|
||||
* const users = [
|
||||
|
||||
1
find.js
1
find.js
@@ -12,6 +12,7 @@ import findIndex from './findIndex.js';
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @param {number} [fromIndex=0] The index to search from.
|
||||
* @returns {*} Returns the matched element, else `undefined`.
|
||||
* @see findIndex, findKey, findLast, findLastIndex, findLastKey
|
||||
* @example
|
||||
*
|
||||
* const users = [
|
||||
|
||||
@@ -14,6 +14,7 @@ const nativeMax = Math.max;
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @param {number} [fromIndex=0] The index to search from.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @see find, findKey, findLast, findLastIndex, findLastKey
|
||||
* @example
|
||||
*
|
||||
* const users = [
|
||||
|
||||
@@ -11,6 +11,7 @@ import baseForOwn from './.internal/baseForOwn.js';
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @returns {string|undefined} Returns the key of the matched element,
|
||||
* else `undefined`.
|
||||
* @see find, findIndex, findLast, findLastIndex, findLastKey
|
||||
* @example
|
||||
*
|
||||
* const users = {
|
||||
|
||||
@@ -11,6 +11,7 @@ import findLastIndex from './findLastIndex.js';
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @param {number} [fromIndex=collection.length-1] The index to search from.
|
||||
* @returns {*} Returns the matched element, else `undefined`.
|
||||
* @see find, findIndex, findKey, findLastIndex, findLastKey
|
||||
* @example
|
||||
*
|
||||
* findLast([1, 2, 3, 4], n => n % 2 == 1);
|
||||
|
||||
@@ -15,6 +15,7 @@ const nativeMin = Math.min;
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @param {number} [fromIndex=array.length-1] The index to search from.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @see find, findIndex, findKey, findLast, findLastKey
|
||||
* @example
|
||||
*
|
||||
* const users = [
|
||||
|
||||
@@ -11,6 +11,7 @@ import baseForOwnRight from './.internal/baseForOwnRight.js';
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @returns {string|undefined} Returns the key of the matched element,
|
||||
* else `undefined`.
|
||||
* @see find, findIndex, findKey, findLast, findLastIndex
|
||||
* @example
|
||||
*
|
||||
* const users = {
|
||||
|
||||
@@ -11,6 +11,7 @@ import map from './map.js';
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @see map, mapKeys, mapValues, flatMapDeep, flatMapDepth, flatten, flattenDeep, flattenDepth
|
||||
* @example
|
||||
*
|
||||
* function duplicate(n) {
|
||||
|
||||
@@ -13,6 +13,7 @@ const INFINITY = 1 / 0;
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @see map, mapKeys, mapValues, flatMap, flatMapDepth, flatten, flattenDeep, flattenDepth
|
||||
* @example
|
||||
*
|
||||
* function duplicate(n) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import toInteger from './toInteger.js';
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {number} [depth=1] The maximum recursion depth.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @see map, mapKeys, mapValues, flatMap, flatMapDeep, flatten, flattenDeep, flattenDepth
|
||||
* @example
|
||||
*
|
||||
* function duplicate(n) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import baseFlatten from './.internal/baseFlatten.js';
|
||||
* @category Array
|
||||
* @param {Array} array The array to flatten.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @see flatMap, flatMapDeep, flatMapDepth, flattenDeep, flattenDepth
|
||||
* @example
|
||||
*
|
||||
* flatten([1, [2, [3, [4]], 5]]);
|
||||
|
||||
@@ -10,6 +10,7 @@ const INFINITY = 1 / 0;
|
||||
* @category Array
|
||||
* @param {Array} array The array to flatten.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @see flatMap, flatMapDeep, flatMapDepth, flatten, flattenDepth
|
||||
* @example
|
||||
*
|
||||
* flattenDeep([1, [2, [3, [4]], 5]]);
|
||||
|
||||
@@ -9,6 +9,7 @@ import toInteger from './toInteger.js';
|
||||
* @param {Array} array The array to flatten.
|
||||
* @param {number} [depth=1] The maximum recursion depth.
|
||||
* @returns {Array} Returns the new flattened array.
|
||||
* @see flatMap, flatMapDeep, flatMapDepth, flattenDeep
|
||||
* @example
|
||||
*
|
||||
* const array = [1, [2, [3, [4]], 5]];
|
||||
|
||||
1
flip.js
1
flip.js
@@ -10,6 +10,7 @@ const WRAP_FLIP_FLAG = 512;
|
||||
* @category Function
|
||||
* @param {Function} func The function to flip arguments for.
|
||||
* @returns {Function} Returns the new flipped function.
|
||||
* @see reverse
|
||||
* @example
|
||||
*
|
||||
* const flipped = flip((...args) => args);
|
||||
|
||||
@@ -16,7 +16,7 @@ import baseEach from './.internal/baseEach.js';;
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
* @see forEachRight
|
||||
* @see forEachRight, forIn, forInRight, forOwn, forOwnRight
|
||||
* @example
|
||||
*
|
||||
* forEach([1, 2], value => console.log(value));
|
||||
|
||||
@@ -11,7 +11,7 @@ import baseEachRight from './.internal/baseEachRight.js';
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Array|Object} Returns `collection`.
|
||||
* @see forEach
|
||||
* @see forEach, forIn, forInRight, forOwn, forOwnRight
|
||||
* @example
|
||||
*
|
||||
* forEachRight([1, 2], value => console.log(value));
|
||||
|
||||
2
forIn.js
2
forIn.js
@@ -12,7 +12,7 @@ import keysIn from './keysIn.js';
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see forInRight
|
||||
* @see forEach, forEachRight, forInRight, forOwn, forOwnRight
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -10,7 +10,7 @@ import keysIn from './keysIn.js';
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see forIn
|
||||
* @see forEach, forEachRight, forIn, forOwn, forOwnRight
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -11,7 +11,7 @@ import baseForOwn from './.internal/baseForOwn.js';
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see forOwnRight
|
||||
* @see forEach, forEachRight, forIn, forInRight, forOwnRight
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -9,7 +9,7 @@ import baseForOwnRight from './.internal/baseForOwnRight.js';
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see forOwn
|
||||
* @see forEach, forEachRight, forIn, forInRight, forOwn
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
1
get.js
1
get.js
@@ -10,6 +10,7 @@ import baseGet from './.internal/baseGet.js';
|
||||
* @param {Array|string} path The path of the property to get.
|
||||
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
||||
* @returns {*} Returns the resolved value.
|
||||
* @see has, hasIn, set, unset
|
||||
* @example
|
||||
*
|
||||
* const object = { 'a': [{ 'b': { 'c': 3 } }] };
|
||||
|
||||
2
gt.js
2
gt.js
@@ -9,7 +9,7 @@ import toNumber from './toNumber.js';
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is greater than `other`,
|
||||
* else `false`.
|
||||
* @see lt
|
||||
* @see lt, gte, lte
|
||||
* @example
|
||||
*
|
||||
* gt(3, 1);
|
||||
|
||||
2
gte.js
2
gte.js
@@ -9,7 +9,7 @@ import toNumber from './toNumber.js';
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is greater than or equal to
|
||||
* `other`, else `false`.
|
||||
* @see lte
|
||||
* @see gt, lt, lte
|
||||
* @example
|
||||
*
|
||||
* gte(3, 1);
|
||||
|
||||
1
has.js
1
has.js
@@ -9,6 +9,7 @@ import hasPath from './.internal/hasPath.js';
|
||||
* @param {Object} object The object to query.
|
||||
* @param {Array|string} path The path to check.
|
||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||
* @see hasIn, set, get
|
||||
* @example
|
||||
*
|
||||
* const object = { 'a': { 'b': 2 } };
|
||||
|
||||
1
hasIn.js
1
hasIn.js
@@ -9,6 +9,7 @@ import hasPath from './.internal/hasPath.js';
|
||||
* @param {Object} object The object to query.
|
||||
* @param {Array|string} path The path to check.
|
||||
* @returns {boolean} Returns `true` if `path` exists, else `false`.
|
||||
* @see has, set, get, unset
|
||||
* @example
|
||||
*
|
||||
* const object = create({ 'a': create({ 'b': 2 }) });
|
||||
|
||||
1
head.js
1
head.js
@@ -6,6 +6,7 @@
|
||||
* @category Array
|
||||
* @param {Array} array The array to query.
|
||||
* @returns {*} Returns the first element of `array`.
|
||||
* @see last
|
||||
* @example
|
||||
*
|
||||
* head([1, 2, 3]);
|
||||
|
||||
@@ -21,6 +21,7 @@ const nativeMax = Math.max;
|
||||
* @param {number} [fromIndex=0] The index to search from.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `reduce`.
|
||||
* @returns {boolean} Returns `true` if `value` is found, else `false`.
|
||||
* @see startsWith, endsWith
|
||||
* @example
|
||||
*
|
||||
* includes([1, 2, 3], 1);
|
||||
|
||||
@@ -10,6 +10,7 @@ import toInteger from './toInteger.js';
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is an integer, else `false`.
|
||||
* @see toInteger, isNumber, toNumber
|
||||
* @example
|
||||
*
|
||||
* isInteger(3);
|
||||
|
||||
@@ -11,6 +11,7 @@ import isObjectLike from './isObjectLike.js';
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a number, else `false`.
|
||||
* @see isInteger, toInteger, toNumber
|
||||
* @example
|
||||
*
|
||||
* isNumber(3);
|
||||
|
||||
@@ -8,6 +8,7 @@ import createCompounder from './.internal/createCompounder.js';
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to convert.
|
||||
* @returns {string} Returns the kebab cased string.
|
||||
* @see upperCase, lowerCase, upperFirst, camelCase, snakeCase, startCase
|
||||
* @example
|
||||
*
|
||||
* kebabCase('Foo Bar');
|
||||
|
||||
1
keyBy.js
1
keyBy.js
@@ -12,6 +12,7 @@ import reduce from './reduce.js';
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} iteratee The iteratee to transform keys.
|
||||
* @returns {Object} Returns the composed aggregate object.
|
||||
* @see groupBy, partition
|
||||
* @example
|
||||
*
|
||||
* const array = [
|
||||
|
||||
1
keys.js
1
keys.js
@@ -13,6 +13,7 @@ import isArrayLike from './isArrayLike.js';
|
||||
* @category Object
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of property names.
|
||||
* @see values, valuesIn
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -7,6 +7,7 @@ import createCompounder from './.internal/createCompounder.js';
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to convert.
|
||||
* @returns {string} Returns the lower cased string.
|
||||
* @see upperCase, upperFirst, camelCase, kebabCase, snakeCase, startCase
|
||||
* @example
|
||||
*
|
||||
* lowerCase('--Foo-Bar--');
|
||||
|
||||
2
lt.js
2
lt.js
@@ -9,7 +9,7 @@ import toNumber from './toNumber.js';
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is less than `other`,
|
||||
* else `false`.
|
||||
* @see gt
|
||||
* @see gt, lte, gte
|
||||
* @example
|
||||
*
|
||||
* lt(1, 3);
|
||||
|
||||
2
lte.js
2
lte.js
@@ -9,7 +9,7 @@ import toNumber from './toNumber.js';
|
||||
* @param {*} other The other value to compare.
|
||||
* @returns {boolean} Returns `true` if `value` is less than or equal to
|
||||
* `other`, else `false`.
|
||||
* @see gte
|
||||
* @see gt, lt, gte
|
||||
* @example
|
||||
*
|
||||
* lte(1, 3);
|
||||
|
||||
@@ -14,6 +14,7 @@ import baseOrderBy from './.internal/baseOrderBy.js';
|
||||
* @param {string[]} [orders] The sort orders of `iteratees`.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `reduce`.
|
||||
* @returns {Array} Returns the new sorted array.
|
||||
* @see reverse
|
||||
* @example
|
||||
*
|
||||
* const users = [
|
||||
|
||||
@@ -11,6 +11,7 @@ import reduce from './reduce.js';
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @returns {Array} Returns the array of grouped elements.
|
||||
* @see groupBy, keyBy
|
||||
* @example
|
||||
*
|
||||
* const users = [
|
||||
|
||||
1
pull.js
1
pull.js
@@ -13,6 +13,7 @@ import pullAll from './pullAll.js';
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {...*} [values] The values to remove.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @see pullAll, pullAllBy, pullAllWith, pullAt, remove, reject
|
||||
* @example
|
||||
*
|
||||
* const array = ['a', 'b', 'c', 'a', 'b', 'c'];
|
||||
|
||||
@@ -10,6 +10,7 @@ import basePullAll from './.internal/basePullAll.js';
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Array} values The values to remove.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @see pull, pullAllBy, pullAllWith, pullAt, remove, reject
|
||||
* @example
|
||||
*
|
||||
* const array = ['a', 'b', 'c', 'a', 'b', 'c'];
|
||||
|
||||
@@ -13,6 +13,7 @@ import basePullAll from './.internal/basePullAll.js';
|
||||
* @param {Array} values The values to remove.
|
||||
* @param {Function} iteratee The iteratee invoked per element.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @see pull, pullAll, pullAllWith, pullAt, remove, reject
|
||||
* @example
|
||||
*
|
||||
* const array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
|
||||
|
||||
@@ -13,6 +13,7 @@ import basePullAll from './.internal/basePullAll.js';
|
||||
* @param {Array} values The values to remove.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @see pull, pullAll, pullAllBy, pullAt, remove, reject
|
||||
* @example
|
||||
*
|
||||
* const array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
|
||||
|
||||
@@ -15,6 +15,7 @@ import isIndex from './.internal/isIndex.js';
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {...(number|number[])} [indexes] The indexes of elements to remove.
|
||||
* @returns {Array} Returns the new array of removed elements.
|
||||
* @see pull, pullAll, pullAllBy, pullAllWith, remove, reject
|
||||
* @example
|
||||
*
|
||||
* const array = ['a', 'b', 'c', 'd'];
|
||||
|
||||
@@ -24,6 +24,7 @@ const nativeRandom = Math.random;
|
||||
* @param {number} [upper=1] The upper bound.
|
||||
* @param {boolean} [floating] Specify returning a floating-point number.
|
||||
* @returns {number} Returns the random number.
|
||||
* @see uniqueId
|
||||
* @example
|
||||
*
|
||||
* random(0, 5);
|
||||
|
||||
@@ -23,7 +23,7 @@ import baseReduce from './.internal/baseReduce.js';
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {*} [accumulator] The initial value.
|
||||
* @returns {*} Returns the accumulated value.
|
||||
* @see reduceRight
|
||||
* @see reduceRight, transform
|
||||
* @example
|
||||
*
|
||||
* reduce([1, 2], (sum, n) => sum + n, 0);
|
||||
|
||||
@@ -11,7 +11,7 @@ import negate from './negate.js';
|
||||
* @param {Array|Object} collection The collection to iterate over.
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @returns {Array} Returns the new filtered array.
|
||||
* @see filter
|
||||
* @see pull, pullAll, pullAllBy, pullAllWith, pullAt, remove, filter
|
||||
* @example
|
||||
*
|
||||
* const users = [
|
||||
|
||||
@@ -13,6 +13,7 @@ import basePullAt from './.internal/basePullAt.js';
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @returns {Array} Returns the new array of removed elements.
|
||||
* @see pull, pullAll, pullAllBy, pullAllWith, pullAt, reject, filter
|
||||
* @example
|
||||
*
|
||||
* const array = [1, 2, 3, 4];
|
||||
|
||||
@@ -12,6 +12,7 @@ import toString from './toString.js';
|
||||
* @param {RegExp|string} pattern The pattern to replace.
|
||||
* @param {Function|string} replacement The match replacement.
|
||||
* @returns {string} Returns the modified string.
|
||||
* @see truncate, trim
|
||||
* @example
|
||||
*
|
||||
* replace('Hi Fred', 'Fred', 'Barney');
|
||||
|
||||
@@ -12,6 +12,7 @@ const nativeReverse = Array.prototype.reverse;
|
||||
* @category Array
|
||||
* @param {Array} array The array to modify.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @see flip, sortBy
|
||||
* @example
|
||||
*
|
||||
* const array = [1, 2, 3];
|
||||
|
||||
1
set.js
1
set.js
@@ -14,6 +14,7 @@ import baseSet from './.internal/baseSet.js';
|
||||
* @param {Array|string} path The path of the property to set.
|
||||
* @param {*} value The value to set.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @see has, hasIn, get, unset
|
||||
* @example
|
||||
*
|
||||
* const object = { 'a': [{ 'b': { 'c': 3 } }] };
|
||||
|
||||
@@ -8,6 +8,7 @@ import createCompounder from './.internal/createCompounder.js';
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to convert.
|
||||
* @returns {string} Returns the snake cased string.
|
||||
* @see upperCase, lowerCase, upperFirst, camelCase, kebabCase, startCase
|
||||
* @example
|
||||
*
|
||||
* snakeCase('Foo Bar');
|
||||
|
||||
@@ -9,6 +9,7 @@ import upperFirst from './upperFirst.js';
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to convert.
|
||||
* @returns {string} Returns the start cased string.
|
||||
* @see upperCase, lowerCase, upperFirst, camelCase, kebabCase, snakeCase
|
||||
* @example
|
||||
*
|
||||
* startCase('--foo-bar--');
|
||||
|
||||
@@ -13,6 +13,7 @@ import toString from './toString.js';
|
||||
* @param {number} [position=0] The position to search from.
|
||||
* @returns {boolean} Returns `true` if `string` starts with `target`,
|
||||
* else `false`.
|
||||
* @see includes, endsWith
|
||||
* @example
|
||||
*
|
||||
* startsWith('abc', 'a');
|
||||
|
||||
@@ -10,6 +10,7 @@ import toFinite from './toFinite.js';
|
||||
* @category Lang
|
||||
* @param {*} value The value to convert.
|
||||
* @returns {number} Returns the converted integer.
|
||||
* @see isInteger, isNumber, toNumber
|
||||
* @example
|
||||
*
|
||||
* toInteger(3.2);
|
||||
|
||||
@@ -26,6 +26,7 @@ const freeParseInt = parseInt;
|
||||
* @category Lang
|
||||
* @param {*} value The value to process.
|
||||
* @returns {number} Returns the number.
|
||||
* @see isInteger, toInteger, isNumber
|
||||
* @example
|
||||
*
|
||||
* toNumber(3.2);
|
||||
|
||||
@@ -21,6 +21,7 @@ import isTypedArray from './isTypedArray.js';
|
||||
* @param {Function} iteratee The function invoked per iteration.
|
||||
* @param {*} [accumulator] The custom accumulator value.
|
||||
* @returns {*} Returns the accumulated value.
|
||||
* @see reduce, reduceRight
|
||||
* @example
|
||||
*
|
||||
* transform([2, 3, 4], (result, n) => {
|
||||
|
||||
1
trim.js
1
trim.js
@@ -17,6 +17,7 @@ const reTrim = /^\s+|\s+$/g;
|
||||
* @param {string} [chars=whitespace] The characters to trim.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
|
||||
* @returns {string} Returns the trimmed string.
|
||||
* @see trimEnd, trimStart
|
||||
* @example
|
||||
*
|
||||
* trim(' abc ');
|
||||
|
||||
@@ -16,6 +16,7 @@ const reTrimEnd = /\s+$/;
|
||||
* @param {string} [chars=whitespace] The characters to trim.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
|
||||
* @returns {string} Returns the trimmed string.
|
||||
* @see trim, trimStart
|
||||
* @example
|
||||
*
|
||||
* trimEnd(' abc ');
|
||||
|
||||
@@ -16,6 +16,7 @@ const reTrimStart = /^\s+/;
|
||||
* @param {string} [chars=whitespace] The characters to trim.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
|
||||
* @returns {string} Returns the trimmed string.
|
||||
* @see trim, trimEnd
|
||||
* @example
|
||||
*
|
||||
* trimStart(' abc ');
|
||||
|
||||
@@ -28,6 +28,7 @@ const reFlags = /\w*$/;
|
||||
* @param {string} [options.omission='...'] The string to indicate text is omitted.
|
||||
* @param {RegExp|string} [options.separator] The separator pattern to truncate to.
|
||||
* @returns {string} Returns the truncated string.
|
||||
* @see replace
|
||||
* @example
|
||||
*
|
||||
* truncate('hi-diddly-ho there, neighborino');
|
||||
|
||||
@@ -25,6 +25,7 @@ const reHasEscapedHtml = RegExp(reEscapedHtml.source);
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to unescape.
|
||||
* @returns {string} Returns the unescaped string.
|
||||
* @see escape, escapeRegExp
|
||||
* @example
|
||||
*
|
||||
* unescape('fred, barney, & pebbles');
|
||||
|
||||
1
union.js
1
union.js
@@ -11,6 +11,7 @@ import isArrayLikeObject from './isArrayLikeObject.js';
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @returns {Array} Returns the new array of combined values.
|
||||
* @see unionBy, unionWith, difference, without, xor, xorBy
|
||||
* @example
|
||||
*
|
||||
* union([2], [1, 2]);
|
||||
|
||||
@@ -15,6 +15,7 @@ import last from './last.js';
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function} iteratee The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new array of combined values.
|
||||
* @see union, unionWith, difference, without, xor, xorBy
|
||||
* @example
|
||||
*
|
||||
* unionBy([2.1], [1.2, 2.3], Math.floor);
|
||||
|
||||
@@ -14,6 +14,7 @@ import last from './last.js';
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new array of combined values.
|
||||
* @see union, unionBy, difference, without, xor, xorBy
|
||||
* @example
|
||||
*
|
||||
* const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
||||
|
||||
1
uniq.js
1
uniq.js
@@ -11,6 +11,7 @@ import baseUniq from './.internal/baseUniq.js';
|
||||
* @category Array
|
||||
* @param {Array} array The array to inspect.
|
||||
* @returns {Array} Returns the new duplicate free array.
|
||||
* @see uniqBy, uniqWith
|
||||
* @example
|
||||
*
|
||||
* uniq([2, 1, 2]);
|
||||
|
||||
@@ -12,6 +12,7 @@ import baseUniq from './.internal/baseUniq.js';
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Function} iteratee The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new duplicate free array.
|
||||
* @see uniq, uniqWith
|
||||
* @example
|
||||
*
|
||||
* uniqBy([2.1, 1.2, 2.3], Math.floor);
|
||||
|
||||
@@ -11,6 +11,7 @@ import baseUniq from './.internal/baseUniq.js';
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new duplicate free array.
|
||||
* @see uniq, uniqBy
|
||||
* @example
|
||||
*
|
||||
* const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
|
||||
|
||||
@@ -10,6 +10,7 @@ let idCounter = 0;
|
||||
* @category Util
|
||||
* @param {string} [prefix=''] The value to prefix the ID with.
|
||||
* @returns {string} Returns the unique ID.
|
||||
* @see random
|
||||
* @example
|
||||
*
|
||||
* uniqueId('contact_');
|
||||
|
||||
1
unset.js
1
unset.js
@@ -10,6 +10,7 @@ import baseUnset from './.internal/baseUnset.js';
|
||||
* @param {Object} object The object to modify.
|
||||
* @param {Array|string} path The path of the property to unset.
|
||||
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
|
||||
* @see has, set, get
|
||||
* @example
|
||||
*
|
||||
* const object = { 'a': [{ 'b': { 'c': 7 } }] };
|
||||
|
||||
1
unzip.js
1
unzip.js
@@ -16,6 +16,7 @@ const nativeMax = Math.max;
|
||||
* @category Array
|
||||
* @param {Array} array The array of grouped elements to process.
|
||||
* @returns {Array} Returns the new array of regrouped elements.
|
||||
* @see zip, zipObject, zipObjectDeep, zipWith, unzipWith
|
||||
* @example
|
||||
*
|
||||
* const zipped = zip(['a', 'b'], [1, 2], [true, false]);
|
||||
|
||||
@@ -7,6 +7,7 @@ import createCompounder from './.internal/createCompounder.js';
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to convert.
|
||||
* @returns {string} Returns the upper cased string.
|
||||
* @see lowerCase, upperFirst, camelCase, kebabCase, snakeCase, startCase
|
||||
* @example
|
||||
*
|
||||
* upperCase('--foo-bar');
|
||||
|
||||
@@ -7,6 +7,7 @@ import createCaseFirst from './.internal/createCaseFirst.js';
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to convert.
|
||||
* @returns {string} Returns the converted string.
|
||||
* @see upperCase, lowerCase, camelCase, kebabCase, snakeCase, startCase
|
||||
* @example
|
||||
*
|
||||
* upperFirst('fred');
|
||||
|
||||
@@ -10,6 +10,7 @@ import keys from './keys.js';
|
||||
* @category Object
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of property values.
|
||||
* @see keys, valuesIn
|
||||
* @example
|
||||
*
|
||||
* function Foo() {
|
||||
|
||||
@@ -13,7 +13,7 @@ import isArrayLikeObject from './isArrayLikeObject.js';
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {...*} [values] The values to exclude.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @see difference, xor
|
||||
* @see difference, xor, xorBy, xorWith, union, unionBy, unionWith
|
||||
* @example
|
||||
*
|
||||
* without([2, 1, 2, 3], 1, 2);
|
||||
|
||||
2
xor.js
2
xor.js
@@ -12,7 +12,7 @@ import isArrayLikeObject from './isArrayLikeObject.js';
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @see difference, without
|
||||
* @see difference, without, xorBy, xorWith, union, unionBy, unionWith
|
||||
* @example
|
||||
*
|
||||
* xor([2, 1], [2, 3]);
|
||||
|
||||
1
xorBy.js
1
xorBy.js
@@ -15,6 +15,7 @@ import last from './last.js';
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function} iteratee The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @see difference, without, xor, xorWith, union, unionBy, unionWith
|
||||
* @example
|
||||
*
|
||||
* xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
|
||||
|
||||
@@ -14,6 +14,7 @@ import last from './last.js';
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @see difference, without, xor, xorBy, union, unionBy, unionWith
|
||||
* @example
|
||||
*
|
||||
* const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
|
||||
|
||||
1
zip.js
1
zip.js
@@ -9,6 +9,7 @@ import unzip from './unzip.js';
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to process.
|
||||
* @returns {Array} Returns the new array of grouped elements.
|
||||
* @see zipObject, zipObjectDeep, zipWith, unzip, unzipWith
|
||||
* @example
|
||||
*
|
||||
* zip(['a', 'b'], [1, 2], [true, false]);
|
||||
|
||||
@@ -10,6 +10,7 @@ import baseZipObject from './.internal/baseZipObject.js';
|
||||
* @param {Array} [props=[]] The property identifiers.
|
||||
* @param {Array} [values=[]] The property values.
|
||||
* @returns {Object} Returns the new object.
|
||||
* @see zip, zipObjectDeep, zipWith, unzip, unzipWith
|
||||
* @example
|
||||
*
|
||||
* zipObject(['a', 'b'], [1, 2]);
|
||||
|
||||
@@ -9,6 +9,7 @@ import baseZipObject from './.internal/baseZipObject.js';
|
||||
* @param {Array} [props=[]] The property identifiers.
|
||||
* @param {Array} [values=[]] The property values.
|
||||
* @returns {Object} Returns the new object.
|
||||
* @see zip, zipObject, zipWith, unzip, unzipWith
|
||||
* @example
|
||||
*
|
||||
* zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
|
||||
|
||||
@@ -11,6 +11,7 @@ import unzipWith from './unzipWith.js';
|
||||
* @param {Function} iteratee The function to combine
|
||||
* grouped values.
|
||||
* @returns {Array} Returns the new array of grouped elements.
|
||||
* @see zip, zipObject, zipObjectDeep, zipWith, unzip, unzipWith
|
||||
* @example
|
||||
*
|
||||
* zipWith([1, 2], [10, 20], [100, 200], (a, b, c) => a + b + c);
|
||||
|
||||
Reference in New Issue
Block a user