Travis build: 1070 [cron]
This commit is contained in:
6
dist/_30s.es5.js
vendored
6
dist/_30s.es5.js
vendored
@ -343,6 +343,11 @@
|
|||||||
|
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
var checkProp = function checkProp(predicate, prop) {
|
||||||
|
return function (obj) {
|
||||||
|
return !!predicate(obj[prop]);
|
||||||
|
};
|
||||||
|
};
|
||||||
var chunk = function chunk(arr, size) {
|
var chunk = function chunk(arr, size) {
|
||||||
return Array.from({
|
return Array.from({
|
||||||
length: Math.ceil(arr.length / size)
|
length: Math.ceil(arr.length / size)
|
||||||
@ -2649,6 +2654,7 @@
|
|||||||
exports.capitalizeEveryWord = capitalizeEveryWord;
|
exports.capitalizeEveryWord = capitalizeEveryWord;
|
||||||
exports.castArray = castArray;
|
exports.castArray = castArray;
|
||||||
exports.chainAsync = chainAsync;
|
exports.chainAsync = chainAsync;
|
||||||
|
exports.checkProp = checkProp;
|
||||||
exports.chunk = chunk;
|
exports.chunk = chunk;
|
||||||
exports.clampNumber = clampNumber;
|
exports.clampNumber = clampNumber;
|
||||||
exports.cloneRegExp = cloneRegExp;
|
exports.cloneRegExp = cloneRegExp;
|
||||||
|
|||||||
2
dist/_30s.es5.min.js
vendored
2
dist/_30s.es5.min.js
vendored
File diff suppressed because one or more lines are too long
9
dist/_30s.esm.js
vendored
9
dist/_30s.esm.js
vendored
@ -115,6 +115,7 @@ const chainAsync = fns => {
|
|||||||
};
|
};
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);
|
||||||
const chunk = (arr, size) =>
|
const chunk = (arr, size) =>
|
||||||
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) =>
|
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) =>
|
||||||
arr.slice(i * size, i * size + size)
|
arr.slice(i * size, i * size + size)
|
||||||
@ -985,9 +986,9 @@ const reject = (pred, array) => array.filter((...args) => !pred(...args));
|
|||||||
const remove = (arr, func) =>
|
const remove = (arr, func) =>
|
||||||
Array.isArray(arr)
|
Array.isArray(arr)
|
||||||
? arr.filter(func).reduce((acc, val) => {
|
? arr.filter(func).reduce((acc, val) => {
|
||||||
arr.splice(arr.indexOf(val), 1);
|
arr.splice(arr.indexOf(val), 1);
|
||||||
return acc.concat(val);
|
return acc.concat(val);
|
||||||
}, [])
|
}, [])
|
||||||
: [];
|
: [];
|
||||||
const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');
|
const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');
|
||||||
const renameKeys = (keysMap, obj) =>
|
const renameKeys = (keysMap, obj) =>
|
||||||
@ -1350,4 +1351,4 @@ const zipWith = (...array) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export { CSVToArray, CSVToJSON, JSONToFile, JSONtoCSV, RGBToHex, URLJoin, UUIDGeneratorBrowser, UUIDGeneratorNode, all, allEqual, any, approximatelyEqual, arrayToCSV, arrayToHtmlList, ary, atob, attempt, average, averageBy, bifurcate, bifurcateBy, bind, bindAll, bindKey, binomialCoefficient, bottomVisible, btoa, byteSize, call, capitalize, capitalizeEveryWord, castArray, chainAsync, chunk, clampNumber, cloneRegExp, coalesce, coalesceFactory, collectInto, colorize, compact, compactWhitespace, compose, composeRight, converge, copyToClipboard, countBy, countOccurrences, counter, createDirIfNotExists, createElement, createEventHub, currentURL, curry, dayOfYear, debounce, decapitalize, deepClone, deepFlatten, deepFreeze, deepMapKeys, defaults, defer, degreesToRads, delay, detectDeviceType, difference, differenceBy, differenceWith, dig, digitize, distance, drop, dropRight, dropRightWhile, dropWhile, elementContains, elementIsVisibleInViewport, elo, equals, escapeHTML, escapeRegExp, everyNth, extendHex, factorial, fibonacci, filterFalsy, filterNonUnique, filterNonUniqueBy, findKey, findLast, findLastIndex, findLastKey, flatten, flattenObject, flip, forEachRight, forOwn, forOwnRight, formatDuration, fromCamelCase, functionName, functions, gcd, geometricProgression, get, getColonTimeFromDate, getDaysDiffBetweenDates, getImages, getMeridiemSuffixOfInteger, getScrollPosition, getStyle, getType, getURLParameters, groupBy, hammingDistance, hasClass, hasFlags, hashBrowser, hashNode, head, hexToRGB, hide, httpGet, httpPost, httpsRedirect, hz, inRange, indentString, indexOfAll, initial, initialize2DArray, initializeArrayWithRange, initializeArrayWithRangeRight, initializeArrayWithValues, initializeNDArray, insertAfter, insertBefore, intersection, intersectionBy, intersectionWith, invertKeyValues, is, isAbsoluteURL, isAfterDate, isAnagram, isArrayLike, isBeforeDate, isBoolean, isBrowser, isBrowserTabFocused, isDivisible, isDuplexStream, isEmpty, isEven, isFunction, isLowerCase, isNegativeZero, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrime, isPrimitive, isPromiseLike, isReadableStream, isSameDate, isSorted, isStream, isString, isSymbol, isTravisCI, isUndefined, isUpperCase, isValidJSON, isWritableStream, join, last, lcm, longestItem, lowercaseKeys, luhnCheck, mapKeys, mapNumRange, mapObject, mapString, mapValues, mask, matches, matchesWith, maxBy, maxDate, maxN, median, memoize, merge, midpoint, minBy, minDate, minN, mostPerformant, negate, nest, nodeListToArray, none, nthArg, nthElement, objectFromPairs, objectToPairs, observeMutations, off, offset, omit, omitBy, on, onUserInputChange, once, orderBy, over, overArgs, pad, palindrome, parseCookie, partial, partialRight, partition, percentile, permutations, pick, pickBy, pipeAsyncFunctions, pipeFunctions, pluralize, powerset, prefix, prettyBytes, primes, promisify, pull, pullAtIndex, pullAtValue, pullBy, radsToDegrees, randomHexColorCode, randomIntArrayInRange, randomIntegerInRange, randomNumberInRange, readFileLines, rearg, recordAnimationFrames, redirect, reduceSuccessive, reduceWhich, reducedFilter, reject, remove, removeNonASCII, renameKeys, reverseString, round, runAsync, runPromisesInSeries, sample, sampleSize, scrollToTop, sdbm, serializeCookie, setStyle, shallowClone, shank, show, shuffle, similarity, size, sleep, smoothScroll, sortCharactersInString, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, splitLines, spreadOver, stableSort, standardDeviation, stringPermutations, stripHTMLTags, sum, sumBy, sumPower, symmetricDifference, symmetricDifferenceBy, symmetricDifferenceWith, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeTaken, times, toCamelCase, toCurrency, toDecimalMark, toHash, toKebabCase, toOrdinalSuffix, toSafeInteger, toSnakeCase, toTitleCase, toggleClass, tomorrow, transform, triggerEvent, truncateString, truthCheckCollection, unary, uncurry, unescapeHTML, unflattenObject, unfold, union, unionBy, unionWith, uniqueElements, uniqueElementsBy, uniqueElementsByRight, uniqueSymmetricDifference, untildify, unzip, unzipWith, validateNumber, vectorDistance, when, without, words, xProd, yesNo, zip, zipObject, zipWith };
|
export { CSVToArray, CSVToJSON, JSONToFile, JSONtoCSV, RGBToHex, URLJoin, UUIDGeneratorBrowser, UUIDGeneratorNode, all, allEqual, any, approximatelyEqual, arrayToCSV, arrayToHtmlList, ary, atob, attempt, average, averageBy, bifurcate, bifurcateBy, bind, bindAll, bindKey, binomialCoefficient, bottomVisible, btoa, byteSize, call, capitalize, capitalizeEveryWord, castArray, chainAsync, checkProp, chunk, clampNumber, cloneRegExp, coalesce, coalesceFactory, collectInto, colorize, compact, compactWhitespace, compose, composeRight, converge, copyToClipboard, countBy, countOccurrences, counter, createDirIfNotExists, createElement, createEventHub, currentURL, curry, dayOfYear, debounce, decapitalize, deepClone, deepFlatten, deepFreeze, deepMapKeys, defaults, defer, degreesToRads, delay, detectDeviceType, difference, differenceBy, differenceWith, dig, digitize, distance, drop, dropRight, dropRightWhile, dropWhile, elementContains, elementIsVisibleInViewport, elo, equals, escapeHTML, escapeRegExp, everyNth, extendHex, factorial, fibonacci, filterFalsy, filterNonUnique, filterNonUniqueBy, findKey, findLast, findLastIndex, findLastKey, flatten, flattenObject, flip, forEachRight, forOwn, forOwnRight, formatDuration, fromCamelCase, functionName, functions, gcd, geometricProgression, get, getColonTimeFromDate, getDaysDiffBetweenDates, getImages, getMeridiemSuffixOfInteger, getScrollPosition, getStyle, getType, getURLParameters, groupBy, hammingDistance, hasClass, hasFlags, hashBrowser, hashNode, head, hexToRGB, hide, httpGet, httpPost, httpsRedirect, hz, inRange, indentString, indexOfAll, initial, initialize2DArray, initializeArrayWithRange, initializeArrayWithRangeRight, initializeArrayWithValues, initializeNDArray, insertAfter, insertBefore, intersection, intersectionBy, intersectionWith, invertKeyValues, is, isAbsoluteURL, isAfterDate, isAnagram, isArrayLike, isBeforeDate, isBoolean, isBrowser, isBrowserTabFocused, isDivisible, isDuplexStream, isEmpty, isEven, isFunction, isLowerCase, isNegativeZero, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrime, isPrimitive, isPromiseLike, isReadableStream, isSameDate, isSorted, isStream, isString, isSymbol, isTravisCI, isUndefined, isUpperCase, isValidJSON, isWritableStream, join, last, lcm, longestItem, lowercaseKeys, luhnCheck, mapKeys, mapNumRange, mapObject, mapString, mapValues, mask, matches, matchesWith, maxBy, maxDate, maxN, median, memoize, merge, midpoint, minBy, minDate, minN, mostPerformant, negate, nest, nodeListToArray, none, nthArg, nthElement, objectFromPairs, objectToPairs, observeMutations, off, offset, omit, omitBy, on, onUserInputChange, once, orderBy, over, overArgs, pad, palindrome, parseCookie, partial, partialRight, partition, percentile, permutations, pick, pickBy, pipeAsyncFunctions, pipeFunctions, pluralize, powerset, prefix, prettyBytes, primes, promisify, pull, pullAtIndex, pullAtValue, pullBy, radsToDegrees, randomHexColorCode, randomIntArrayInRange, randomIntegerInRange, randomNumberInRange, readFileLines, rearg, recordAnimationFrames, redirect, reduceSuccessive, reduceWhich, reducedFilter, reject, remove, removeNonASCII, renameKeys, reverseString, round, runAsync, runPromisesInSeries, sample, sampleSize, scrollToTop, sdbm, serializeCookie, setStyle, shallowClone, shank, show, shuffle, similarity, size, sleep, smoothScroll, sortCharactersInString, sortedIndex, sortedIndexBy, sortedLastIndex, sortedLastIndexBy, splitLines, spreadOver, stableSort, standardDeviation, stringPermutations, stripHTMLTags, sum, sumBy, sumPower, symmetricDifference, symmetricDifferenceBy, symmetricDifferenceWith, tail, take, takeRight, takeRightWhile, takeWhile, throttle, timeTaken, times, toCamelCase, toCurrency, toDecimalMark, toHash, toKebabCase, toOrdinalSuffix, toSafeInteger, toSnakeCase, toTitleCase, toggleClass, tomorrow, transform, triggerEvent, truncateString, truthCheckCollection, unary, uncurry, unescapeHTML, unflattenObject, unfold, union, unionBy, unionWith, uniqueElements, uniqueElementsBy, uniqueElementsByRight, uniqueSymmetricDifference, untildify, unzip, unzipWith, validateNumber, vectorDistance, when, without, words, xProd, yesNo, zip, zipObject, zipWith };
|
||||||
|
|||||||
8
dist/_30s.js
vendored
8
dist/_30s.js
vendored
@ -121,6 +121,7 @@
|
|||||||
};
|
};
|
||||||
next();
|
next();
|
||||||
};
|
};
|
||||||
|
const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);
|
||||||
const chunk = (arr, size) =>
|
const chunk = (arr, size) =>
|
||||||
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) =>
|
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) =>
|
||||||
arr.slice(i * size, i * size + size)
|
arr.slice(i * size, i * size + size)
|
||||||
@ -991,9 +992,9 @@
|
|||||||
const remove = (arr, func) =>
|
const remove = (arr, func) =>
|
||||||
Array.isArray(arr)
|
Array.isArray(arr)
|
||||||
? arr.filter(func).reduce((acc, val) => {
|
? arr.filter(func).reduce((acc, val) => {
|
||||||
arr.splice(arr.indexOf(val), 1);
|
arr.splice(arr.indexOf(val), 1);
|
||||||
return acc.concat(val);
|
return acc.concat(val);
|
||||||
}, [])
|
}, [])
|
||||||
: [];
|
: [];
|
||||||
const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');
|
const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');
|
||||||
const renameKeys = (keysMap, obj) =>
|
const renameKeys = (keysMap, obj) =>
|
||||||
@ -1389,6 +1390,7 @@
|
|||||||
exports.capitalizeEveryWord = capitalizeEveryWord;
|
exports.capitalizeEveryWord = capitalizeEveryWord;
|
||||||
exports.castArray = castArray;
|
exports.castArray = castArray;
|
||||||
exports.chainAsync = chainAsync;
|
exports.chainAsync = chainAsync;
|
||||||
|
exports.checkProp = checkProp;
|
||||||
exports.chunk = chunk;
|
exports.chunk = chunk;
|
||||||
exports.clampNumber = clampNumber;
|
exports.clampNumber = clampNumber;
|
||||||
exports.cloneRegExp = cloneRegExp;
|
exports.cloneRegExp = cloneRegExp;
|
||||||
|
|||||||
@ -373,6 +373,22 @@
|
|||||||
"hash": "ae8f373cb6c661896ce4256e9f8a2f7f9c14f1699651d366af038f66a938f70e"
|
"hash": "ae8f373cb6c661896ce4256e9f8a2f7f9c14f1699651d366af038f66a938f70e"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "checkProp",
|
||||||
|
"type": "snippetListing",
|
||||||
|
"attributes": {
|
||||||
|
"tags": [
|
||||||
|
"function",
|
||||||
|
"object",
|
||||||
|
"utility",
|
||||||
|
"beginner"
|
||||||
|
],
|
||||||
|
"archived": false
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"hash": "2051a5037b3830e219c84dae16f72f42a8a8aee5e8f96bd98f506ea7c4f3bb42"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "chunk",
|
"id": "chunk",
|
||||||
"type": "snippetListing",
|
"type": "snippetListing",
|
||||||
@ -3391,7 +3407,7 @@
|
|||||||
"archived": false
|
"archived": false
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "0b04f5fe668888db0dc360535cd999669258019f0682eb6e4ad3a1164e408d13"
|
"hash": "dcdf66e8d0eb4a1761c6b767b8cc350757087ae817ec371436faab0fff7c0051"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -3763,7 +3779,7 @@
|
|||||||
"archived": false
|
"archived": false
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "536833a64ce0c000b82327ed1bb9bcb82e35b237f75aefcca0e0d2def4e9cb63"
|
"hash": "2fd54c9fc1fb5b0a981df69501b518d5830ea77544d4d5290c7cc13745ca00ea"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -5321,7 +5337,7 @@
|
|||||||
"archived": true
|
"archived": true
|
||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"hash": "7af37e0984b5c8bd78d6b224cdc155f8c2bf687e38b5cfee27f32c7c29dcddf5"
|
"hash": "ac13cf4ff52357534c814d458895d6a70a5193a552398f9cac7f86016a5e6544"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -548,6 +548,29 @@
|
|||||||
"hash": "ae8f373cb6c661896ce4256e9f8a2f7f9c14f1699651d366af038f66a938f70e"
|
"hash": "ae8f373cb6c661896ce4256e9f8a2f7f9c14f1699651d366af038f66a938f70e"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "checkProp",
|
||||||
|
"type": "snippet",
|
||||||
|
"attributes": {
|
||||||
|
"fileName": "checkProp.md",
|
||||||
|
"text": "Given a `predicate` function and a `prop` string, this curried function will then take an `object` to inspect by calling the property and passing it to the predicate.\n\nSummon `prop` on `obj`, pass it to a provided `predicate` function and return a masked boolean.",
|
||||||
|
"codeBlocks": {
|
||||||
|
"es6": "const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);",
|
||||||
|
"es5": "var checkProp = function checkProp(predicate, prop) {\n return function (obj) {\n return !!predicate(obj[prop]);\n };\n};",
|
||||||
|
"example": "const lengthIs4 = checkProp(l => l === 4, 'length');\nlengthIs4([]); // false\nlengthIs4([1,2,3,4]); // true\nlengthIs4(new Set([1,2,3,4])); // false (Set uses Size, not length)\n\nconst session = { user: {} };\nconst validUserSession = checkProps(u => u.active && !u.disabled, 'user');\n\nvalidUserSession(session); // false\n\nsession.user.active = true;\nvalidUserSession(session); // true\n\nconst noLength(l => l === undefined, 'length');\nnoLength([]); // false\nnoLength({}); // true\nnoLength(new Set()); // true"
|
||||||
|
},
|
||||||
|
"tags": [
|
||||||
|
"function",
|
||||||
|
"object",
|
||||||
|
"utility",
|
||||||
|
"beginner"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"archived": false,
|
||||||
|
"hash": "2051a5037b3830e219c84dae16f72f42a8a8aee5e8f96bd98f506ea7c4f3bb42"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "chunk",
|
"id": "chunk",
|
||||||
"type": "snippet",
|
"type": "snippet",
|
||||||
@ -4983,7 +5006,7 @@
|
|||||||
"codeBlocks": {
|
"codeBlocks": {
|
||||||
"es6": "const pipeAsyncFunctions = (...fns) => arg => fns.reduce((p, f) => p.then(f), Promise.resolve(arg));",
|
"es6": "const pipeAsyncFunctions = (...fns) => arg => fns.reduce((p, f) => p.then(f), Promise.resolve(arg));",
|
||||||
"es5": "var pipeAsyncFunctions = function pipeAsyncFunctions() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (arg) {\n return fns.reduce(function (p, f) {\n return p.then(f);\n }, Promise.resolve(arg));\n };\n};",
|
"es5": "var pipeAsyncFunctions = function pipeAsyncFunctions() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (arg) {\n return fns.reduce(function (p, f) {\n return p.then(f);\n }, Promise.resolve(arg));\n };\n};",
|
||||||
"example": "const sum = pipeAsyncFunctions(\n x => x + 1,\n x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)),\n x => x + 3,\n async x => (await x) + 4\n);\n(async() => {\n console.log(await sum(5)); // 15 (after one second)\n})();"
|
"example": "const sum = pipeAsyncFunctions(\n x => x + 1,\n x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)),\n x => x + 3,\n async x => (await x) + 4\n);\n(async () => {\n console.log(await sum(5)); // 15 (after one second)\n})();"
|
||||||
},
|
},
|
||||||
"tags": [
|
"tags": [
|
||||||
"adapter",
|
"adapter",
|
||||||
@ -4994,7 +5017,7 @@
|
|||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"archived": false,
|
"archived": false,
|
||||||
"hash": "0b04f5fe668888db0dc360535cd999669258019f0682eb6e4ad3a1164e408d13"
|
"hash": "dcdf66e8d0eb4a1761c6b767b8cc350757087ae817ec371436faab0fff7c0051"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -5530,7 +5553,7 @@
|
|||||||
"fileName": "remove.md",
|
"fileName": "remove.md",
|
||||||
"text": "Removes elements from an array for which the given function returns `false`.\n\nUse `Array.prototype.filter()` to find array elements that return truthy values and `Array.prototype.reduce()` to remove elements using `Array.prototype.splice()`.\nThe `func` is invoked with three arguments (`value, index, array`).",
|
"text": "Removes elements from an array for which the given function returns `false`.\n\nUse `Array.prototype.filter()` to find array elements that return truthy values and `Array.prototype.reduce()` to remove elements using `Array.prototype.splice()`.\nThe `func` is invoked with three arguments (`value, index, array`).",
|
||||||
"codeBlocks": {
|
"codeBlocks": {
|
||||||
"es6": "const remove = (arr, func) =>\n Array.isArray(arr)\n ? arr.filter(func).reduce((acc, val) => {\n arr.splice(arr.indexOf(val), 1);\n return acc.concat(val);\n }, [])\n : [];",
|
"es6": "const remove = (arr, func) =>\n Array.isArray(arr)\n ? arr.filter(func).reduce((acc, val) => {\n arr.splice(arr.indexOf(val), 1);\n return acc.concat(val);\n }, [])\n : [];",
|
||||||
"es5": "var remove = function remove(arr, func) {\n return Array.isArray(arr) ? arr.filter(func).reduce(function (acc, val) {\n arr.splice(arr.indexOf(val), 1);\n return acc.concat(val);\n }, []) : [];\n};",
|
"es5": "var remove = function remove(arr, func) {\n return Array.isArray(arr) ? arr.filter(func).reduce(function (acc, val) {\n arr.splice(arr.indexOf(val), 1);\n return acc.concat(val);\n }, []) : [];\n};",
|
||||||
"example": "remove([1, 2, 3, 4], n => n % 2 === 0); // [2, 4]"
|
"example": "remove([1, 2, 3, 4], n => n % 2 === 0); // [2, 4]"
|
||||||
},
|
},
|
||||||
@ -5541,7 +5564,7 @@
|
|||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"archived": false,
|
"archived": false,
|
||||||
"hash": "536833a64ce0c000b82327ed1bb9bcb82e35b237f75aefcca0e0d2def4e9cb63"
|
"hash": "2fd54c9fc1fb5b0a981df69501b518d5830ea77544d4d5290c7cc13745ca00ea"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -7876,7 +7899,7 @@
|
|||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"archived": true,
|
"archived": true,
|
||||||
"hash": "7af37e0984b5c8bd78d6b224cdc155f8c2bf687e38b5cfee27f32c7c29dcddf5"
|
"hash": "ac13cf4ff52357534c814d458895d6a70a5193a552398f9cac7f86016a5e6544"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -218,6 +218,13 @@
|
|||||||
],
|
],
|
||||||
"description": "Chains asynchronous functions.\n\nLoop through an array of functions containing asynchronous events, calling `next` when each asynchronous event has completed"
|
"description": "Chains asynchronous functions.\n\nLoop through an array of functions containing asynchronous events, calling `next` when each asynchronous event has completed"
|
||||||
},
|
},
|
||||||
|
"checkProp": {
|
||||||
|
"prefix": "30s_checkProp",
|
||||||
|
"body": [
|
||||||
|
"const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);"
|
||||||
|
],
|
||||||
|
"description": "Given a `predicate` function and a `prop` string, this curried function will then take an `object` to inspect by calling the property and passing it to the predicate.\n\nSummon `prop` on `obj`, pass it to a provided `predicate` function and return a masked boolean"
|
||||||
|
},
|
||||||
"chunk": {
|
"chunk": {
|
||||||
"prefix": "30s_chunk",
|
"prefix": "30s_chunk",
|
||||||
"body": [
|
"body": [
|
||||||
@ -2490,9 +2497,9 @@
|
|||||||
"const remove = (arr, func) =>",
|
"const remove = (arr, func) =>",
|
||||||
" Array.isArray(arr)",
|
" Array.isArray(arr)",
|
||||||
" ? arr.filter(func).reduce((acc, val) => {",
|
" ? arr.filter(func).reduce((acc, val) => {",
|
||||||
" arr.splice(arr.indexOf(val), 1);",
|
" arr.splice(arr.indexOf(val), 1);",
|
||||||
" return acc.concat(val);",
|
" return acc.concat(val);",
|
||||||
" }, [])",
|
" }, [])",
|
||||||
" : [];"
|
" : [];"
|
||||||
],
|
],
|
||||||
"description": "Removes elements from an array for which the given function returns `false`.\n\nUse `Array.prototype.filter()` to find array elements that return truthy values and `Array.prototype.reduce()` to remove elements using `Array.prototype.splice()`.\nThe `func` is invoked with three arguments (`value, index, array`)"
|
"description": "Removes elements from an array for which the given function returns `false`.\n\nUse `Array.prototype.filter()` to find array elements that return truthy values and `Array.prototype.reduce()` to remove elements using `Array.prototype.splice()`.\nThe `func` is invoked with three arguments (`value, index, array`)"
|
||||||
|
|||||||
Reference in New Issue
Block a user