fix conflicts

This commit is contained in:
Rohit Tanwar
2018-02-17 22:10:34 +05:30
55 changed files with 246 additions and 367 deletions

18
.npmignore Normal file
View File

@ -0,0 +1,18 @@
snippet-template.md
tag_database
travis.log
CONTRIBUTING.md
COLLABORATING.md
CODE_OF_CONDUCT.md
.travis.yml
.mdlrc.style.rb
.mdlrc
.codeclimate.yml
test/*
static-parts/*
snippets_archive/*
scripts/*
locale/*
docs/*
.travis/*
.github/*

View File

@ -99,9 +99,7 @@ average(1, 2, 3);
<summary>View contents</summary>
* [`all`](#all)
* [`allBy`](#allby)
* [`any`](#any)
* [`anyBy`](#anyby)
* [`bifurcate`](#bifurcate)
* [`bifurcateBy`](#bifurcateby)
* [`chunk`](#chunk)
@ -141,7 +139,6 @@ average(1, 2, 3);
* [`maxN`](#maxn)
* [`minN`](#minn)
* [`none`](#none)
* [`noneBy`](#noneby)
* [`nthElement`](#nthelement)
* [`partition`](#partition)
* [`pull`](#pull)
@ -776,41 +773,21 @@ const unary = fn => val => fn(val);
### all
Returns `true` if all elements in a collection are truthy, `false` otherwise.
Use `Array.every(Boolean)` to test if all elements in the collection are truthy.
```js
const all = arr => arr.every(Boolean);
```
<details>
<summary>Examples</summary>
```js
all([1, 2, 3]); // true
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### allBy
Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise.
Use `Array.every()` to test if all elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const allBy = (arr, fn) => arr.every(fn);
const all = (arr, fn = Boolean) => arr.every(fn);
```
<details>
<summary>Examples</summary>
```js
allBy([4, 2, 3], x => x > 1); // true
all([4, 2, 3], x => x > 1); // true
all([1, 2, 3]); // true
```
</details>
@ -820,41 +797,21 @@ allBy([4, 2, 3], x => x > 1); // true
### any
Returns `true` if at least one element in a collection is truthy, `false` otherwise.
Use `Array.some(Boolean)` to test if any elements in the collection are truthy.
```js
const any = arr => arr.some(Boolean);
```
<details>
<summary>Examples</summary>
```js
any([0, 0, 1, 0]); // true
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### anyBy
Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise.
Use `Array.some()` to test if any elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const anyBy = (arr, fn) => arr.some(fn);
const any = (arr, fn = Boolean) => arr.some(fn);
```
<details>
<summary>Examples</summary>
```js
anyBy([0, 1, 2, 0], x => x >= 2); // true
any([0, 1, 2, 0], x => x >= 2); // true
any([0, 0, 1, 0]); // true
```
</details>
@ -1815,41 +1772,21 @@ minN([1, 2, 3], 2); // [1,2]
### none
Returns `true` if no elements in a collection are truthy, `false` otherwise.
Use `!Array.some(Boolean)` to test if any elements in the collection are truthy.
```js
const none = arr => !arr.some(Boolean);
```
<details>
<summary>Examples</summary>
```js
none([0, 0, 0]); // true
```
</details>
<br>[⬆ Back to top](#table-of-contents)
### noneBy
Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise.
Use `Array.some()` to test if any elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const noneBy = (arr, fn) => !arr.some(fn);
const none = (arr, fn = Boolean) => !arr.some(fn);
```
<details>
<summary>Examples</summary>
```js
noneBy([0, 1, 3, 0], x => x == 2); // true
none([0, 1, 3, 0], x => x == 2); // true
none([0, 0, 0]); // true
```
</details>

17
dist/_30s.es5.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

14
dist/_30s.esm.js vendored
View File

@ -25,9 +25,7 @@ const UUIDGeneratorNode = () =>
(c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
);
const all = arr => arr.every(Boolean);
const allBy = (arr, fn) => arr.every(fn);
const all = (arr, fn = Boolean) => arr.every(fn);
const anagrams = str => {
if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
@ -40,9 +38,7 @@ const anagrams = str => {
);
};
const any = arr => arr.some(Boolean);
const anyBy = (arr, fn) => arr.some(fn);
const any = (arr, fn = Boolean) => arr.some(fn);
const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
@ -792,9 +788,7 @@ const mostPerformant = (fns, iterations = 10000) => {
const negate = func => (...args) => !func(...args);
const none = arr => !arr.some(Boolean);
const noneBy = (arr, fn) => !arr.some(fn);
const none = (arr, fn = Boolean) => !arr.some(fn);
const nthArg = n => (...args) => args.slice(n)[0];
@ -1423,6 +1417,6 @@ const zipWith = (...arrays) => {
return fn ? result.map(arr => fn(...arr)) : result;
};
var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,allBy,anagrams,any,anyBy,approximatelyEqual,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,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,noneBy,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,anagrams,any,approximatelyEqual,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,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
export default imports;

14
dist/_30s.js vendored
View File

@ -31,9 +31,7 @@ const UUIDGeneratorNode = () =>
(c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
);
const all = arr => arr.every(Boolean);
const allBy = (arr, fn) => arr.every(fn);
const all = (arr, fn = Boolean) => arr.every(fn);
const anagrams = str => {
if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
@ -46,9 +44,7 @@ const anagrams = str => {
);
};
const any = arr => arr.some(Boolean);
const anyBy = (arr, fn) => arr.some(fn);
const any = (arr, fn = Boolean) => arr.some(fn);
const approximatelyEqual = (v1, v2, epsilon = 0.001) => Math.abs(v1 - v2) < epsilon;
@ -798,9 +794,7 @@ const mostPerformant = (fns, iterations = 10000) => {
const negate = func => (...args) => !func(...args);
const none = arr => !arr.some(Boolean);
const noneBy = (arr, fn) => !arr.some(fn);
const none = (arr, fn = Boolean) => !arr.some(fn);
const nthArg = n => (...args) => args.slice(n)[0];
@ -1429,7 +1423,7 @@ const zipWith = (...arrays) => {
return fn ? result.map(arr => fn(...arr)) : result;
};
var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,allBy,anagrams,any,anyBy,approximatelyEqual,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,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,noneBy,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,all,anagrams,any,approximatelyEqual,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,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,debounce,decapitalize,deepClone,deepFlatten,defaults,defer,degreesToRads,delay,detectDeviceType,difference,differenceBy,differenceWith,digitize,distance,drop,dropRight,dropRightWhile,dropWhile,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findKey,findLast,findLastIndex,findLastKey,flatten,flattenObject,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getColonTimeFromDate,getDaysDiffBetweenDates,getMeridiemSuffixOfInteger,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,intersectionBy,intersectionWith,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEmpty,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,matches,matchesWith,maxBy,maxN,median,memoize,merge,minBy,minN,mostPerformant,negate,none,nthArg,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,over,overArgs,palindrome,parseCookie,partial,partialRight,partition,percentile,pick,pickBy,pipeAsyncFunctions,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,pullBy,radsToDegrees,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,rearg,redirect,reduceSuccessive,reduceWhich,reducedFilter,remove,removeNonASCII,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,splitLines,spreadOver,standardDeviation,stripHTMLTags,sum,sumBy,sumPower,symmetricDifference,symmetricDifferenceBy,symmetricDifferenceWith,tail,take,takeRight,takeRightWhile,takeWhile,throttle,timeTaken,times,toCamelCase,toCurrency,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unary,uncurry,unescapeHTML,unflattenObject,unfold,union,unionBy,unionWith,uniqueElements,untildify,unzip,unzipWith,validateNumber,without,words,xProd,yesNo,zip,zipObject,zipWith,}
return imports;

2
dist/_30s.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@
},
"name": "30-seconds-of-code",
"description": "A collection of useful JavaScript snippets.",
"version": "0.0.1",
"version": "0.0.2",
"main": "dist/_30s.js",
"module": "dist/_30s.esm.js",
"scripts": {

View File

@ -1,13 +1,15 @@
### all
Returns `true` if all elements in a collection are truthy, `false` otherwise.
Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise.
Use `Array.every(Boolean)` to test if all elements in the collection are truthy.
Use `Array.every()` to test if all elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const all = arr => arr.every(Boolean);
const all = (arr, fn = Boolean) => arr.every(fn);
```
```js
all([4, 2, 3], x => x > 1); // true
all([1, 2, 3]); // true
```

View File

@ -1,13 +0,0 @@
### allBy
Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise.
Use `Array.every()` to test if all elements in the collection return `true` based on `fn`.
```js
const allBy = (arr, fn) => arr.every(fn);
```
```js
allBy([4, 2, 3], x => x > 1); // true
```

View File

@ -1,13 +1,15 @@
### any
Returns `true` if at least one element in a collection is truthy, `false` otherwise.
Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise.
Use `Array.some(Boolean)` to test if any elements in the collection are truthy.
Use `Array.some()` to test if any elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const any = arr => arr.some(Boolean);
const any = (arr, fn = Boolean) => arr.some(fn);
```
```js
any([0, 1, 2, 0], x => x >= 2); // true
any([0, 0, 1, 0]); // true
```

View File

@ -1,13 +0,0 @@
### anyBy
Returns `true` if the provided predicate function returns `true` for at least one element in a collection, `false` otherwise.
Use `Array.some()` to test if any elements in the collection return `true` based on `fn`.
```js
const anyBy = (arr, fn) => arr.some(fn);
```
```js
anyBy([0, 1, 2, 0], x => x >= 2); // true
```

View File

@ -1,13 +1,15 @@
### none
Returns `true` if no elements in a collection are truthy, `false` otherwise.
Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise.
Use `!Array.some(Boolean)` to test if any elements in the collection are truthy.
Use `Array.some()` to test if any elements in the collection return `true` based on `fn`.
Omit the second argument, `fn`, to use `Boolean` as a default.
```js
const none = arr => !arr.some(Boolean);
const none = (arr, fn = Boolean) => !arr.some(fn);
```
```js
none([0, 1, 3, 0], x => x == 2); // true
none([0, 0, 0]); // true
```

View File

@ -1,13 +0,0 @@
### noneBy
Returns `true` if the provided predicate function returns `false` for all elements in a collection, `false` otherwise.
Use `Array.some()` to test if any elements in the collection return `true` based on `fn`.
```js
const noneBy = (arr, fn) => !arr.some(fn);
```
```js
noneBy([0, 1, 3, 0], x => x == 2); // true
```

View File

@ -1,8 +1,6 @@
all:array
allBy:array,function
all:array,function
anagrams:string,recursion
any:array
anyBy:array,function
any:array,function
approximatelyEqual:math
arrayToHtmlList:browser,array
ary:adapter,function
@ -164,8 +162,7 @@ minBy:math,array,function
minN:array,math
mostPerformant:utility,function
negate:function
none:array
noneBy:array,function
none:array,function
nthArg:utility,function
nthElement:array
objectFromPairs:object,array

View File

@ -1,2 +1,2 @@
const all = arr => arr.every(Boolean);
const all = (arr, fn = Boolean) => arr.every(fn);
module.exports = all;

View File

@ -11,6 +11,8 @@ test('Testing all', (t) => {
t.false(all([undefined,1]), 'Returns false for arrays with undefined');
t.false(all([null,1]), 'Returns false for arrays with null');
t.false(all(['',1]), 'Returns false for arrays with empty strings');
t.true(all([4,1,2,3], x => x >= 1), 'Returns true with predicate function');
t.false(all([0,1], x => x >= 1), 'Returns false with a predicate function');
//t.deepEqual(all(args..), 'Expected');
//t.equal(all(args..), 'Expected');
//t.false(all(args..), 'Expected');

View File

@ -1,2 +0,0 @@
const allBy = (arr, fn) => arr.every(fn);
module.exports = allBy;

View File

@ -1,15 +0,0 @@
const test = require('tape');
const allBy = require('./allBy.js');
test('Testing allBy', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof allBy === 'function', 'allBy is a Function');
t.true(allBy([4,1,2,3], x => x >= 1), 'Returns true with predicate function');
t.false(allBy([0,1], x => x >= 1), 'Returns false with a predicate function');
//t.deepEqual(allBy(args..), 'Expected');
//t.equal(allBy(args..), 'Expected');
//t.false(allBy(args..), 'Expected');
//t.throws(allBy(args..), 'Expected');
t.end();
});

View File

@ -1,2 +1,2 @@
const any = arr => arr.some(Boolean);
const any = (arr, fn = Boolean) => arr.some(fn);
module.exports = any;

View File

@ -8,6 +8,8 @@ test('Testing any', (t) => {
t.true(any([0,1,2,3]), 'Returns true for arrays with at least one truthy value');
t.false(any([0,0]), 'Returns false for arrays with no truthy values');
t.false(any([NaN,0,undefined,null,'']), 'Returns false for arrays with no truthy values');
t.true(any([4,1,0,3], x => x >= 1), 'Returns true with predicate function');
t.false(any([0,1], x => x < 0), 'Returns false with a predicate function');
//t.deepEqual(any(args..), 'Expected');
//t.equal(any(args..), 'Expected');
//t.false(any(args..), 'Expected');

View File

@ -1,2 +0,0 @@
const anyBy = (arr, fn) => arr.some(fn);
module.exports = anyBy;

View File

@ -1,15 +0,0 @@
const test = require('tape');
const anyBy = require('./anyBy.js');
test('Testing anyBy', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof anyBy === 'function', 'anyBy is a Function');
t.true(anyBy([4,1,0,3], x => x >= 1), 'Returns true with predicate function');
t.false(anyBy([0,1], x => x < 0), 'Returns false with a predicate function');
//t.deepEqual(anyBy(args..), 'Expected');
//t.equal(anyBy(args..), 'Expected');
//t.false(anyBy(args..), 'Expected');
//t.throws(anyBy(args..), 'Expected');
t.end();
});

View File

@ -5,6 +5,7 @@ test('Testing arrayToHtmlList', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof arrayToHtmlList === 'function', 'arrayToHtmlList is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(arrayToHtmlList(args..), 'Expected');
//t.equal(arrayToHtmlList(args..), 'Expected');
//t.false(arrayToHtmlList(args..), 'Expected');

View File

@ -5,22 +5,19 @@ test('Testing chainAsync', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof chainAsync === 'function', 'chainAsync is a Function');
//t.deepEqual(chainAsync(args..), 'Expected');
// chainAsync([
// next => {
// next();
// },
// next => {
// (() =>{
// next()
// })();
// },
// next => {
// t.pass("Calls all functions in an array");
// next();
// }
// ]);
//
chainAsync([
next => {
next();
},
next => {
(() => {
next();
})();
},
next => {
t.pass("Calls all functions in an array");
}
]);
// // Ensure we wait for the 2nd assertion to be made
// t.plan(2);

View File

@ -5,6 +5,7 @@ test('Testing createElement', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof createElement === 'function', 'createElement is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(createElement(args..), 'Expected');
//t.equal(createElement(args..), 'Expected');
//t.false(createElement(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing createEventHub', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof createEventHub === 'function', 'createEventHub is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(createEventHub(args..), 'Expected');
//t.equal(createEventHub(args..), 'Expected');
//t.false(createEventHub(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing currentURL', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof currentURL === 'function', 'currentURL is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(currentURL(args..), 'Expected');
//t.equal(currentURL(args..), 'Expected');
//t.false(currentURL(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing debounce', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof debounce === 'function', 'debounce is a Function');
debounce(() => {t.pass('Works as expected');}, 250);
//t.deepEqual(debounce(args..), 'Expected');
//t.equal(debounce(args..), 'Expected');
//t.false(debounce(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing defaults', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof defaults === 'function', 'defaults is a Function');
t.deepEqual(defaults({ a: 1 }, { b: 2 }, { b: 6 }, { a: 3 }), { a: 1, b: 2 }, 'Assigns default values for undefined properties');
//t.deepEqual(defaults(args..), 'Expected');
//t.equal(defaults(args..), 'Expected');
//t.false(defaults(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing defer', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof defer === 'function', 'defer is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(defer(args..), 'Expected');
//t.equal(defer(args..), 'Expected');
//t.false(defer(args..), 'Expected');

View File

@ -5,6 +5,13 @@ test('Testing delay', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof delay === 'function', 'delay is a Function');
delay(
function(text) {
t.equals(text, 'test', 'Works as expecting, passing arguments properly');
},
1000,
'test'
);
//t.deepEqual(delay(args..), 'Expected');
//t.equal(delay(args..), 'Expected');
//t.false(delay(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing getScrollPosition', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof getScrollPosition === 'function', 'getScrollPosition is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(getScrollPosition(args..), 'Expected');
//t.equal(getScrollPosition(args..), 'Expected');
//t.false(getScrollPosition(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing getStyle', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof getStyle === 'function', 'getStyle is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(getStyle(args..), 'Expected');
//t.equal(getStyle(args..), 'Expected');
//t.false(getStyle(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing hasFlags', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof hasFlags === 'function', 'hasFlags is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(hasFlags(args..), 'Expected');
//t.equal(hasFlags(args..), 'Expected');
//t.false(hasFlags(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing hashBrowser', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof hashBrowser === 'function', 'hashBrowser is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(hashBrowser(args..), 'Expected');
//t.equal(hashBrowser(args..), 'Expected');
//t.false(hashBrowser(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing hide', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof hide === 'function', 'hide is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(hide(args..), 'Expected');
//t.equal(hide(args..), 'Expected');
//t.false(hide(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing mostPerformant', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof mostPerformant === 'function', 'mostPerformant is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(mostPerformant(args..), 'Expected');
//t.equal(mostPerformant(args..), 'Expected');
//t.false(mostPerformant(args..), 'Expected');

View File

@ -1,2 +1,2 @@
const none = arr => !arr.some(Boolean);
const none = (arr, fn = Boolean) => !arr.some(fn);
module.exports = none;

View File

@ -7,6 +7,8 @@ test('Testing none', (t) => {
t.true(typeof none === 'function', 'none is a Function');
t.true(none([0,undefined,NaN,null,'']), 'Returns true for arrays with no truthy values');
t.false(none([0,1]), 'Returns false for arrays with at least one truthy value');
t.true(none([4,1,0,3], x => x < 0), 'Returns true with a predicate function');
t.false(none([0,1,2], x => x === 1), 'Returns false with predicate function');
//t.deepEqual(none(args..), 'Expected');
//t.equal(none(args..), 'Expected');
//t.false(none(args..), 'Expected');

View File

@ -1,2 +0,0 @@
const noneBy = (arr, fn) => !arr.some(fn);
module.exports = noneBy;

View File

@ -1,15 +0,0 @@
const test = require('tape');
const noneBy = require('./noneBy.js');
test('Testing noneBy', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof noneBy === 'function', 'noneBy is a Function');
t.true(noneBy([4,1,0,3], x => x < 0), 'Returns true with a predicate function');
t.false(noneBy([0,1,2], x => x === 1), 'Returns false with predicate function');
//t.deepEqual(noneBy(args..), 'Expected');
//t.equal(noneBy(args..), 'Expected');
//t.false(noneBy(args..), 'Expected');
//t.throws(noneBy(args..), 'Expected');
t.end();
});

View File

@ -5,6 +5,7 @@ test('Testing off', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof off === 'function', 'off is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(off(args..), 'Expected');
//t.equal(off(args..), 'Expected');
//t.false(off(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing on', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof on === 'function', 'on is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(on(args..), 'Expected');
//t.equal(on(args..), 'Expected');
//t.false(on(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing onUserInputChange', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof onUserInputChange === 'function', 'onUserInputChange is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(onUserInputChange(args..), 'Expected');
//t.equal(onUserInputChange(args..), 'Expected');
//t.false(onUserInputChange(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing once', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof once === 'function', 'once is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(once(args..), 'Expected');
//t.equal(once(args..), 'Expected');
//t.false(once(args..), 'Expected');

View File

@ -8,7 +8,7 @@ test('Testing randomHexColorCode', (t) => {
//t.deepEqual(randomHexColorCode(args..), 'Expected');
t.equal(randomHexColorCode().length, 7);
t.true(randomHexColorCode().startsWith('#'),'The color code starts with "#"');
t.true(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null)
t.true(randomHexColorCode().slice(1).match(/[^0123456789abcdef]/i) === null,'The color code contains only valid hex-digits');
//t.false(randomHexColorCode(args..), 'Expected');
//t.throws(randomHexColorCode(args..), 'Expected');
t.end();

View File

@ -5,6 +5,7 @@ test('Testing setStyle', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof setStyle === 'function', 'setStyle is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(setStyle(args..), 'Expected');
//t.equal(setStyle(args..), 'Expected');
//t.false(setStyle(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing show', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof show === 'function', 'show is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(show(args..), 'Expected');
//t.equal(show(args..), 'Expected');
//t.false(show(args..), 'Expected');

View File

@ -5,6 +5,10 @@ test('Testing sleep', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof sleep === 'function', 'sleep is a Function');
async function sleepyWork() {
await sleep(1000);
t.pass('Works as expected');
}
//t.deepEqual(sleep(args..), 'Expected');
//t.equal(sleep(args..), 'Expected');
//t.false(sleep(args..), 'Expected');

View File

@ -1,24 +1,20 @@
Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Test log for: Fri Feb 16 2018 20:23:57 GMT+0000 (UTC)
> 30-seconds-of-code@0.0.1 test R:\github\30-seconds-of-code
> 30-seconds-of-code@0.0.2 test /home/travis/build/Chalarangelo/30-seconds-of-code
> tape test/**/*.test.js | tap-spec
Testing all
all is a Function
Returns true for arrays with no falsey values
Returns false for arrays with 0
Returns false for arrays with NaN
Returns false for arrays with undefined
Returns false for arrays with null
Returns false for arrays with empty strings
Testing allBy
√ allBy is a Function
√ Returns true with predicate function
√ Returns false with a predicate function
all is a Function
Returns true for arrays with no falsey values
Returns false for arrays with 0
Returns false for arrays with NaN
Returns false for arrays with undefined
Returns false for arrays with null
Returns false for arrays with empty strings
✔ Returns true with predicate function
✔ Returns false with a predicate function
Testing anagrams
@ -29,16 +25,12 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing any
any is a Function
Returns true for arrays with at least one truthy value
Returns false for arrays with no truthy values
Returns false for arrays with no truthy values
Testing anyBy
√ anyBy is a Function
√ Returns true with predicate function
√ Returns false with a predicate function
any is a Function
Returns true for arrays with at least one truthy value
Returns false for arrays with no truthy values
Returns false for arrays with no truthy values
✔ Returns true with predicate function
✔ Returns false with a predicate function
Testing approximatelyEqual
@ -50,7 +42,8 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing arrayToHtmlList
arrayToHtmlList is a Function
arrayToHtmlList is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing ary
@ -71,18 +64,18 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing average
average is a Function
average(true) returns 0
average(false) returns 1
average(9, 1) returns 5
average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092
average(1, 2, 3) returns 2
average(null) returns 0
average(1, 2, 3) returns NaN
average(String) returns NaN
average({ a: 123}) returns NaN
average([undefined, 0, string]) returns NaN
average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run
average is a Function
average(true) returns 0
average(false) returns 1
average(9, 1) returns 5
average(153, 44, 55, 64, 71, 1122, 322774, 2232, 23423, 234, 3631) returns 32163.909090909092
average(1, 2, 3) returns 2
average(null) returns 0
average(1, 2, 3) returns NaN
average(String) returns NaN
average({ a: 123}) returns NaN
average([undefined, 0, string]) returns NaN
average([1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 1122, 32124, 23232]) takes less than 2s to run
Testing averageBy
@ -180,7 +173,8 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing chainAsync
chainAsync is a Function
chainAsync is a Function
✔ Calls all functions in an array
Testing chunk
@ -279,15 +273,18 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing createElement
createElement is a Function
createElement is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing createEventHub
createEventHub is a Function
createEventHub is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing currentURL
currentURL is a Function
currentURL is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing curry
@ -318,11 +315,13 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing defaults
defaults is a Function
defaults is a Function
✔ Assigns default values for undefined properties
Testing defer
defer is a Function
defer is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing degreesToRads
@ -576,11 +575,13 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing getScrollPosition
getScrollPosition is a Function
getScrollPosition is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing getStyle
getStyle is a Function
getStyle is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing getType
@ -609,11 +610,13 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing hasFlags
hasFlags is a Function
hasFlags is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing hashBrowser
hashBrowser is a Function
hashBrowser is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing hashNode
@ -640,7 +643,8 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing hide
hide is a Function
hide is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing howManyTimes
@ -1086,7 +1090,8 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing mostPerformant
mostPerformant is a Function
mostPerformant is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing negate
@ -1095,15 +1100,11 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing none
none is a Function
Returns true for arrays with no truthy values
Returns false for arrays with at least one truthy value
Testing noneBy
√ noneBy is a Function
√ Returns true with a predicate function
√ Returns false with predicate function
none is a Function
Returns true for arrays with no truthy values
Returns false for arrays with at least one truthy value
✔ Returns true with a predicate function
✔ Returns false with predicate function
Testing nthArg
@ -1135,7 +1136,8 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing off
off is a Function
off is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing omit
@ -1149,15 +1151,18 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing on
on is a Function
on is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing once
once is a Function
onUserInputChange is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing onUserInputChange
onUserInputChange is a Function
once is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing orderBy
@ -1299,10 +1304,10 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing randomHexColorCode
randomHexColorCode is a Function
should be equal
The color code starts with "#"
√ should be truthy
randomHexColorCode is a Function
should be equal
The color code starts with "#"
✔ The color code contains only valid hex-digits
Testing randomIntArrayInRange
@ -1435,7 +1440,8 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing setStyle
setStyle is a Function
setStyle is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing shallowClone
@ -1445,7 +1451,8 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing show
show is a Function
show is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing shuffle
@ -1586,12 +1593,13 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing throttle
throttle is a Function
throttle is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing times
times is a Function
√ Runs a function the specified amount of times
timeTaken is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing timeTaken
@ -1656,18 +1664,8 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing toSafeInteger
toSafeInteger is a Function
√ Number(toSafeInteger(3.2)) is a number
√ Converts a value to a safe integer
√ toSafeInteger('4.2') returns 4
√ toSafeInteger(4.6) returns 5
√ toSafeInteger([]) returns 0
√ isNaN(toSafeInteger([1.5, 3124])) is true
√ isNaN(toSafeInteger('string')) is true
√ isNaN(toSafeInteger({})) is true
√ isNaN(toSafeInteger()) is true
√ toSafeInteger(Infinity) returns 9007199254740991
√ toSafeInteger(3.2) takes less than 2s to run
toggleClass is a Function
✔ Tested by @chalarangelo on 16/02/2018
Testing toSnakeCase
@ -1890,16 +1888,17 @@ Test log for: Sat Feb 17 2018 21:51:17 GMT+0530 (India Standard Time)
Testing zipWith
zipWith is a Function
√ Runs the function provided
Runs promises in series
Sends a GET request
√ Works with multiple promises
√ Sends a POST request
zipWith is a Function
✔ Sends a GET request
Runs the function provided
Sends a POST request
✔ Runs promises in series
✔ Works as expecting, passing arguments properly
✔ Works with multiple promises
total: 951
passing: 951
duration: 5.6s
total: 970
passing: 970
duration: 2.5s

View File

@ -5,6 +5,7 @@ test('Testing throttle', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof throttle === 'function', 'throttle is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(throttle(args..), 'Expected');
//t.equal(throttle(args..), 'Expected');
//t.false(throttle(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing timeTaken', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof timeTaken === 'function', 'timeTaken is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(timeTaken(args..), 'Expected');
//t.equal(timeTaken(args..), 'Expected');
//t.false(timeTaken(args..), 'Expected');

View File

@ -5,6 +5,7 @@ test('Testing toggleClass', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof toggleClass === 'function', 'toggleClass is a Function');
t.pass('Tested by @chalarangelo on 16/02/2018');
//t.deepEqual(toggleClass(args..), 'Expected');
//t.equal(toggleClass(args..), 'Expected');
//t.false(toggleClass(args..), 'Expected');