diff --git a/README.md b/README.md index 9e64eb736..f777b2eed 100644 --- a/README.md +++ b/README.md @@ -2304,9 +2304,9 @@ The `func` is invoked with three arguments (`value, index, array`). const remove = (arr, func) => Array.isArray(arr) ? arr.filter(func).reduce((acc, val) => { - arr.splice(arr.indexOf(val), 1); - return acc.concat(val); - }, []) + arr.splice(arr.indexOf(val), 1); + return acc.concat(val); + }, []) : []; ``` diff --git a/docs/index.html b/docs/index.html index fce6b50d2..8e7f052d7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -406,9 +406,9 @@
Removes elements from an array for which the given function returns false.
Use Array.prototype.filter() to find array elements that return truthy values and Array.prototype.reduce() to remove elements using Array.prototype.splice(). The func is invoked with three arguments (value, index, array).
const remove = (arr, func) => Array.isArray(arr) ? arr.filter(func).reduce((acc, val) => { - arr.splice(arr.indexOf(val), 1); - return acc.concat(val); - }, []) + arr.splice(arr.indexOf(val), 1); + return acc.concat(val); + }, []) : [];
remove([1, 2, 3, 4], n => n % 2 === 0); // [2, 4]
Returns a random element from an array.
Use Math.random() to generate a random number, multiply it by length and round it off to the nearest whole number using Math.floor(). This method also works with strings.
const sample = arr => arr[Math.floor(Math.random() * arr.length)]; diff --git a/snippets/remove.md b/snippets/remove.md index a8c472774..58de9c2e0 100644 --- a/snippets/remove.md +++ b/snippets/remove.md @@ -9,9 +9,9 @@ The `func` is invoked with three arguments (`value, index, array`). const remove = (arr, func) => Array.isArray(arr) ? arr.filter(func).reduce((acc, val) => { - arr.splice(arr.indexOf(val), 1); - return acc.concat(val); - }, []) + arr.splice(arr.indexOf(val), 1); + return acc.concat(val); + }, []) : []; ``` diff --git a/test/_30s.js b/test/_30s.js index 2bc0ff3f1..cadfa3f13 100644 --- a/test/_30s.js +++ b/test/_30s.js @@ -1,5 +1,5 @@ -const fs = typeof require !== 'undefined' && require('fs'); -const crypto = typeof require !== 'undefined' && require('crypto'); +const fs = typeof require !== "undefined" && require('fs'); +const crypto = typeof require !== "undefined" && require('crypto'); const CSVToArray = (data, delimiter = ',', omitFirstRow = false) => data @@ -1337,11 +1337,11 @@ const binarySearch = (arr, val, start = 0, end = arr.length - 1) => { const celsiusToFahrenheit = degrees => 1.8 * degrees + 32; const cleanObj = (obj, keysToKeep = [], childIndicator) => { Object.keys(obj).forEach(key => { - if (key === childIndicator) + if (key === childIndicator) { cleanObj(obj[key], keysToKeep, childIndicator); - else if (!keysToKeep.includes(key)) + } else if (!keysToKeep.includes(key)) { delete obj[key]; - + } }); return obj; }; @@ -1358,16 +1358,15 @@ const factors = (num, primes = false) => { let array = Array.from({ length: num - 1 }) .map((val, i) => (num % (i + 2) === 0 ? i + 2 : false)) .filter(val => val); - if (isNeg) { + if (isNeg) array = array.reduce((acc, val) => { acc.push(val); acc.push(-val); return acc; }, []); - } return primes ? array.filter(isPrime) : array; }; -const fahrenheitToCelsius = degrees => (degrees - 32) * 5 / 9; +const fahrenheitToCelsius = degrees => (degrees - 32) * 5/9; const fibonacciCountUntilNum = num => Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2)); const fibonacciUntilNum = num => { @@ -1378,9 +1377,9 @@ const fibonacciUntilNum = num => { ); }; const heronArea = (side_a, side_b, side_c) => { - const p = (side_a + side_b + side_c) / 2; - return Math.sqrt(p * (p - side_a) * (p - side_b) * (p - side_c)); -}; + const p = (side_a + side_b + side_c) / 2 + return Math.sqrt(p * (p-side_a) * (p-side_b) * (p-side_c)) + }; const howManyTimes = (num, divisor) => { if (divisor === 1 || divisor === -1) return Infinity; if (divisor === 0) return 0; @@ -1400,8 +1399,8 @@ const httpDelete = (url, callback, err = console.error) => { }; const httpPut = (url, data, callback, err = console.error) => { const request = new XMLHttpRequest(); - request.open('PUT', url, true); - request.setRequestHeader('Content-type', 'application/json; charset=utf-8'); + request.open("PUT", url, true); + request.setRequestHeader('Content-type','application/json; charset=utf-8'); request.onload = () => callback(request); request.onerror = () => err(request); request.send(data); @@ -1412,13 +1411,13 @@ const isArmstrongNumber = digits => ); const isSimilar = (pattern, str) => [...str].reduce( - (matchIndex, char) => - char.toLowerCase() === (pattern[matchIndex] || '').toLowerCase() - ? matchIndex + 1 - : matchIndex, - 0 + (matchIndex, char) => + char.toLowerCase() === (pattern[matchIndex] || '').toLowerCase() + ? matchIndex + 1 + : matchIndex, + 0 ) === pattern.length; -const kmphToMph = kmph => 0.621371192 * kmph; +const kmphToMph = (kmph) => 0.621371192 * kmph; const levenshteinDistance = (string1, string2) => { if (string1.length === 0) return string2.length; if (string2.length === 0) return string1.length; @@ -1430,9 +1429,9 @@ const levenshteinDistance = (string1, string2) => { .map((x, i) => i); for (let i = 1; i <= string2.length; i++) { for (let j = 1; j <= string1.length; j++) { - if (string2[i - 1] === string1[j - 1]) + if (string2[i - 1] === string1[j - 1]) { matrix[i][j] = matrix[i - 1][j - 1]; - else { + } else { matrix[i][j] = Math.min( matrix[i - 1][j - 1] + 1, matrix[i][j - 1] + 1, @@ -1443,16 +1442,16 @@ const levenshteinDistance = (string1, string2) => { } return matrix[string2.length][string1.length]; }; -const mphToKmph = mph => 1.6093440006146922 * mph; +const mphToKmph = (mph) => 1.6093440006146922 * mph; const pipeLog = data => console.log(data) || data; const quickSort = ([n, ...nums], desc) => isNaN(n) ? [] : [ - ...quickSort(nums.filter(v => (desc ? v > n : v <= n)), desc), - n, - ...quickSort(nums.filter(v => (!desc ? v > n : v <= n)), desc) - ]; + ...quickSort(nums.filter(v => (desc ? v > n : v <= n)), desc), + n, + ...quickSort(nums.filter(v => (!desc ? v > n : v <= n)), desc) + ]; const removeVowels = (str, repl = '') => str.replace(/[aeiou]/gi, repl); const solveRPN = rpn => { const OPERATORS = { @@ -1470,14 +1469,14 @@ const solveRPN = rpn => { .filter(el => !/\s+/.test(el) && el !== '') ]; solve.forEach(symbol => { - if (!isNaN(parseFloat(symbol)) && isFinite(symbol)) + if (!isNaN(parseFloat(symbol)) && isFinite(symbol)) { stack.push(symbol); - else if (Object.keys(OPERATORS).includes(symbol)) { + } else if (Object.keys(OPERATORS).includes(symbol)) { const [a, b] = [stack.pop(), stack.pop()]; stack.push(OPERATORS[symbol](parseFloat(b), parseFloat(a))); - } else + } else { throw `${symbol} is not a recognized symbol`; - + } }); if (stack.length === 1) return stack.pop(); else throw `${rpn} is not a proper RPN. Please check it and try again`; @@ -1490,4 +1489,4 @@ const speechSynthesis = message => { const squareSum = (...args) => args.reduce((squareSum, number) => squareSum + Math.pow(number, 2), 0); -module.exports = {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, compose, composeRight, converge, copyToClipboard, countBy, countOccurrences, counter, createElement, createEventHub, currentURL, curry, dayOfYear, debounce, decapitalize, deepClone, deepFlatten, deepFreeze, 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, 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, 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, mapObject, mapString, mapValues, mask, matches, matchesWith, maxBy, maxDate, maxN, median, memoize, merge, 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, when, without, words, xProd, yesNo, zip, zipObject, zipWith, JSONToDate, binarySearch, celsiusToFahrenheit, cleanObj, collatz, countVowels, factors, fahrenheitToCelsius, fibonacciCountUntilNum, fibonacciUntilNum, heronArea, howManyTimes, httpDelete, httpPut, isArmstrongNumber, isSimilar, kmphToMph, levenshteinDistance, mphToKmph, pipeLog, quickSort, removeVowels, solveRPN, speechSynthesis, squareSum}; +module.exports = {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,compose,composeRight,converge,copyToClipboard,countBy,countOccurrences,counter,createElement,createEventHub,currentURL,curry,dayOfYear,debounce,decapitalize,deepClone,deepFlatten,deepFreeze,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,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,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,mapObject,mapString,mapValues,mask,matches,matchesWith,maxBy,maxDate,maxN,median,memoize,merge,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,when,without,words,xProd,yesNo,zip,zipObject,zipWith,JSONToDate,binarySearch,celsiusToFahrenheit,cleanObj,collatz,countVowels,factors,fahrenheitToCelsius,fibonacciCountUntilNum,fibonacciUntilNum,heronArea,howManyTimes,httpDelete,httpPut,isArmstrongNumber,isSimilar,kmphToMph,levenshteinDistance,mphToKmph,pipeLog,quickSort,removeVowels,solveRPN,speechSynthesis,squareSum} \ No newline at end of file diff --git a/test/testlog b/test/testlog index f1da53cc6..ba590ccdf 100644 --- a/test/testlog +++ b/test/testlog @@ -468,20 +468,20 @@ ok 346 — Gets the correct meridiem suffix. ok 347 — Gets the correct meridiem suffix. ok 348 — Gets the correct meridiem suffix. -# PASS test/getImages.test.js - -ok 349 — getImages is a Function -ok 350 — getImages returns an Array -ok 351 — getImages removes duplicates from images Array - # PASS test/sampleSize.test.js -ok 352 — sampleSize is a Function -ok 353 — Returns a single element without n specified -ok 354 — Returns a random sample of specified size from an array -ok 355 — Returns all elements in an array if n >= length -ok 356 — Returns an empty array if original array is empty -ok 357 — Returns an empty array if n = 0 +ok 349 — sampleSize is a Function +ok 350 — Returns a single element without n specified +ok 351 — Returns a random sample of specified size from an array +ok 352 — Returns all elements in an array if n >= length +ok 353 — Returns an empty array if original array is empty +ok 354 — Returns an empty array if n = 0 + +# PASS test/getImages.test.js + +ok 355 — getImages is a Function +ok 356 — getImages returns an Array +ok 357 — getImages removes duplicates from images Array # PASS test/orderBy.test.js @@ -534,45 +534,45 @@ ok 385 — isReadableStream returns false for write streams ok 386 — isReadableStream returns true for duplex streams ok 387 — isReadableStream returns false for non-streams +# PASS test/fahrenheitToCelsius.test.js + +ok 388 — fahrenheitToCelsius is a Function +ok 389 — 32 Fahrenheit is 0 Celsius +ok 390 — 212 Fahrenheit is 100 Celsius +ok 391 — 150 Fahrenheit is 65.55555555555556 Celsius +ok 392 — 1000 Fahrenheit is 537.7777777777778 +ok 393 — Not a number value is NaN + # PASS test/inRange.test.js -ok 388 — inRange is a Function -ok 389 — The given number falls within the given range -ok 390 — The given number falls within the given range (reverse) -ok 391 — The given number falls within the given range -ok 392 — The given number does not falls within the given range -ok 393 — The given number does not falls within the given range +ok 394 — inRange is a Function +ok 395 — The given number falls within the given range +ok 396 — The given number falls within the given range (reverse) +ok 397 — The given number falls within the given range +ok 398 — The given number does not falls within the given range +ok 399 — The given number does not falls within the given range # PASS test/any.test.js -ok 394 — any is a Function -ok 395 — Returns true for arrays with at least one truthy value -ok 396 — Returns false for arrays with no truthy values -ok 397 — Returns false for arrays with no truthy values -ok 398 — Returns true with predicate function -ok 399 — Returns false with a predicate function +ok 400 — any is a Function +ok 401 — Returns true for arrays with at least one truthy value +ok 402 — Returns false for arrays with no truthy values +ok 403 — Returns false for arrays with no truthy values +ok 404 — Returns true with predicate function +ok 405 — Returns false with a predicate function # PASS test/randomIntegerInRange.test.js -ok 400 — randomIntegerInRange is a Function -ok 401 — The returned value is an integer -ok 402 — The returned value lies between provided lowerLimit and upperLimit (both inclusive). +ok 406 — randomIntegerInRange is a Function +ok 407 — The returned value is an integer +ok 408 — The returned value lies between provided lowerLimit and upperLimit (both inclusive). # PASS test/initializeArrayWithRange.test.js -ok 403 — initializeArrayWithRange is a Function -ok 404 — Initializes an array containing the numbers in the specified range (witout start value) -ok 405 — Initializes an array containing the numbers in the specified range -ok 406 — Initializes an array containing the numbers in the specified range (with step) - -# PASS test/fahrenheitToCelsius.test.js - -ok 407 — fahrenheitToCelsius is a Function -ok 408 — 32 Fahrenheit is 0 Celsius -ok 409 — 212 Fahrenheit is 100 Celsius -ok 410 — 150 Fahrenheit is 65.55555555555556 Celsius -ok 411 — 1000 Fahrenheit is 537.7777777777778 -ok 412 — Not a number value is NaN +ok 409 — initializeArrayWithRange is a Function +ok 410 — Initializes an array containing the numbers in the specified range (witout start value) +ok 411 — Initializes an array containing the numbers in the specified range +ok 412 — Initializes an array containing the numbers in the specified range (with step) # PASS test/sortedIndexBy.test.js @@ -647,43 +647,43 @@ ok 453 — Initializes an array containing the numbers in the specified range ok 454 — Initializes an array containing the numbers in the specified range ok 455 — Initializes an array containing the numbers in the specified range +# PASS test/celsiusToFahrenheit.test.js + +ok 456 — celsiusToFahrenheit is a Function +ok 457 — 0 Celsius is 32 Fahrenheit +ok 458 — 100 Celsius is 212 Fahrenheit +ok 459 — -50 Celsius is -58 Fahrenheit +ok 460 — 1000 Celsius is 1832 Fahrenheit +ok 461 — Not a number value is NaN + # PASS test/mapString.test.js -ok 456 — mapString is a Function -ok 457 — mapString returns a capitalized string -ok 458 — mapString can deal with indexes -ok 459 — mapString can deal with the full string +ok 462 — mapString is a Function +ok 463 — mapString returns a capitalized string +ok 464 — mapString can deal with indexes +ok 465 — mapString can deal with the full string # PASS test/dig.test.js -ok 460 — dig is a Function -ok 461 — Dig target success -ok 462 — Dig target with falsey value -ok 463 — Dig target with array -ok 464 — Unknown target return undefined +ok 466 — dig is a Function +ok 467 — Dig target success +ok 468 — Dig target with falsey value +ok 469 — Dig target with array +ok 470 — Unknown target return undefined # PASS test/levenshteinDistance.test.js -ok 465 — levenshteinDistance is a Function -ok 466 — levenshteinDistance returns the correct results -ok 467 — levenshteinDistance returns the correct result for 0-length string as first argument -ok 468 — levenshteinDistance returns the correct result for 0-length string as second argument +ok 471 — levenshteinDistance is a Function +ok 472 — levenshteinDistance returns the correct results +ok 473 — levenshteinDistance returns the correct result for 0-length string as first argument +ok 474 — levenshteinDistance returns the correct result for 0-length string as second argument # PASS test/sortedLastIndex.test.js -ok 469 — sortedLastIndex is a Function -ok 470 — Returns the highest index to insert the element without messing up the list order -ok 471 — Returns the highest index to insert the element without messing up the list order -ok 472 — Returns the highest index to insert the element without messing up the list order - -# PASS test/celsiusToFahrenheit.test.js - -ok 473 — celsiusToFahrenheit is a Function -ok 474 — 0 Celsius is 32 Fahrenheit -ok 475 — 100 Celsius is 212 Fahrenheit -ok 476 — -50 Celsius is -58 Fahrenheit -ok 477 — 1000 Celsius is 1832 Fahrenheit -ok 478 — Not a number value is NaN +ok 475 — sortedLastIndex is a Function +ok 476 — Returns the highest index to insert the element without messing up the list order +ok 477 — Returns the highest index to insert the element without messing up the list order +ok 478 — Returns the highest index to insert the element without messing up the list order # PASS test/reduceWhich.test.js @@ -922,41 +922,41 @@ ok 614 — Converts a color code to a rgb() or rgba() string ok 615 — partition is a Function ok 616 — Groups the elements into two arrays, depending on the provided function's truthiness for each element. -# PASS test/isPromiseLike.test.js - -ok 617 — isPromiseLike is a Function -ok 618 — Returns true for a promise-like object -ok 619 — Returns false for an empty object -ok 620 — Returns false for a normal function - # PASS test/stringPermutations.test.js -ok 621 — stringPermutations is a Function -ok 622 — Generates all stringPermutations of a string -ok 623 — Works for single-letter strings -ok 624 — Works for empty strings +ok 617 — stringPermutations is a Function +ok 618 — Generates all stringPermutations of a string +ok 619 — Works for single-letter strings +ok 620 — Works for empty strings # PASS test/sumPower.test.js -ok 625 — sumPower is a Function -ok 626 — Returns the sum of the powers of all the numbers from start to end -ok 627 — Returns the sum of the powers of all the numbers from start to end -ok 628 — Returns the sum of the powers of all the numbers from start to end +ok 621 — sumPower is a Function +ok 622 — Returns the sum of the powers of all the numbers from start to end +ok 623 — Returns the sum of the powers of all the numbers from start to end +ok 624 — Returns the sum of the powers of all the numbers from start to end # PASS test/isObjectLike.test.js -ok 629 — isObjectLike is a Function -ok 630 — Returns true for an object -ok 631 — Returns true for an array -ok 632 — Returns false for a function -ok 633 — Returns false for null +ok 625 — isObjectLike is a Function +ok 626 — Returns true for an object +ok 627 — Returns true for an array +ok 628 — Returns false for a function +ok 629 — Returns false for null # PASS test/untildify.test.js -ok 634 — untildify is a Function -ok 635 — Contains no tildes -ok 636 — Does not alter the rest of the path -ok 637 — Does not alter paths without tildes +ok 630 — untildify is a Function +ok 631 — Contains no tildes +ok 632 — Does not alter the rest of the path +ok 633 — Does not alter paths without tildes + +# PASS test/isPromiseLike.test.js + +ok 634 — isPromiseLike is a Function +ok 635 — Returns true for a promise-like object +ok 636 — Returns false for an empty object +ok 637 — Returns false for a normal function # PASS test/isObject.test.js @@ -1245,28 +1245,28 @@ ok 784 — initializeNDArray is a Function ok 785 — Initializes a n-D array with given data ok 786 — Initializes a n-D array with given data -# PASS test/bindKey.test.js - -ok 787 — bindKey is a Function -ok 788 — Binds function to an object context - # PASS test/getType.test.js -ok 789 — getType is a Function -ok 790 — Returns the native type of a value -ok 791 — Returns null for null -ok 792 — Returns undefined for undefined +ok 787 — getType is a Function +ok 788 — Returns the native type of a value +ok 789 — Returns null for null +ok 790 — Returns undefined for undefined # PASS test/findLastKey.test.js -ok 793 — findLastKey is a Function -ok 794 — eturns the appropriate key +ok 791 — findLastKey is a Function +ok 792 — eturns the appropriate key # PASS test/arrayToCSV.test.js -ok 795 — arrayToCSV is a Function -ok 796 — arrayToCSV works with default delimiter -ok 797 — arrayToCSV works with custom delimiter +ok 793 — arrayToCSV is a Function +ok 794 — arrayToCSV works with default delimiter +ok 795 — arrayToCSV works with custom delimiter + +# PASS test/bindKey.test.js + +ok 796 — bindKey is a Function +ok 797 — Binds function to an object context # PASS test/promisify.test.js @@ -1353,16 +1353,16 @@ ok 835 — Merges two objects ok 836 — bind is a Function ok 837 — Binds to an object context -# PASS test/pullAtIndex.test.js - -ok 838 — pullAtIndex is a Function -ok 839 — Pulls the given values -ok 840 — Pulls the given values - # PASS test/triggerEvent.test.js -ok 841 — triggerEvent is a Function -ok 842 — triggerEvent triggers an event +ok 838 — triggerEvent is a Function +ok 839 — triggerEvent triggers an event + +# PASS test/pullAtIndex.test.js + +ok 840 — pullAtIndex is a Function +ok 841 — Pulls the given values +ok 842 — Pulls the given values # PASS test/indentString.test.js @@ -1393,45 +1393,45 @@ ok 854 — toHash is a Function ok 855 — toHash works properly with indexes ok 856 — toHash works properly with keys +# PASS test/isTravisCI.test.js + +ok 857 — isTravisCI is a Function +ok 858 — Running on Travis, correctly evaluates + # PASS test/isNil.test.js -ok 857 — isNil is a Function -ok 858 — Returns true for null -ok 859 — Returns true for undefined -ok 860 — Returns false for an empty string +ok 859 — isNil is a Function +ok 860 — Returns true for null +ok 861 — Returns true for undefined +ok 862 — Returns false for an empty string # PASS test/coalesceFactory.test.js -ok 861 — coalesceFactory is a Function -ok 862 — Returns a customized coalesce function +ok 863 — coalesceFactory is a Function +ok 864 — Returns a customized coalesce function # PASS test/indexOfAll.test.js -ok 863 — indexOfAll is a Function -ok 864 — Returns all indices of val in an array -ok 865 — When val is not found, return an empty array +ok 865 — indexOfAll is a Function +ok 866 — Returns all indices of val in an array +ok 867 — When val is not found, return an empty array # PASS test/extendHex.test.js -ok 866 — extendHex is a Function -ok 867 — Extends a 3-digit color code to a 6-digit color code -ok 868 — Extends a 3-digit color code to a 6-digit color code +ok 868 — extendHex is a Function +ok 869 — Extends a 3-digit color code to a 6-digit color code +ok 870 — Extends a 3-digit color code to a 6-digit color code # PASS test/isPlainObject.test.js -ok 869 — isPlainObject is a Function -ok 870 — Returns true for a plain object -ok 871 — Returns false for a Map (example of non-plain object) +ok 871 — isPlainObject is a Function +ok 872 — Returns true for a plain object +ok 873 — Returns false for a Map (example of non-plain object) # PASS test/maxDate.test.js -ok 872 — maxDate is a Function -ok 873 — maxDate produces the maximum date - -# PASS test/isTravisCI.test.js - -ok 874 — isTravisCI is a Function -ok 875 — Running on Travis, correctly evaluates +ok 874 — maxDate is a Function +ok 875 — maxDate produces the maximum date # PASS test/intersectionBy.test.js @@ -1458,16 +1458,16 @@ ok 883 — Performs left-to-right function composition ok 884 — reduceSuccessive is a Function ok 885 — Returns the array of successively reduced values -# PASS test/chainAsync.test.js - -ok 886 — chainAsync is a Function -ok 887 — Calls all functions in an array - # PASS test/sumBy.test.js -ok 888 — sumBy is a Function -ok 889 — Works with a callback. -ok 890 — Works with a property name. +ok 886 — sumBy is a Function +ok 887 — Works with a callback. +ok 888 — Works with a property name. + +# PASS test/chainAsync.test.js + +ok 889 — chainAsync is a Function +ok 890 — Calls all functions in an array # PASS test/countBy.test.js @@ -1595,63 +1595,63 @@ ok 945 — solveRPN is a Function ok 946 — solveRPN returns the correct result ok 947 — solveRPN returns the correct result -# PASS test/bindAll.test.js - -ok 948 — bindAll is a Function -ok 949 — Binds to an object context - # PASS test/percentile.test.js -ok 950 — percentile is a Function -ok 951 — Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. +ok 948 — percentile is a Function +ok 949 — Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value. # PASS test/httpDelete.test.js -ok 952 — httpDelete is a Function -ok 953 — httpDelete does not throw errors +ok 950 — httpDelete is a Function +ok 951 — httpDelete does not throw errors # PASS test/getDaysDiffBetweenDates.test.js -ok 954 — getDaysDiffBetweenDates is a Function -ok 955 — Returns the difference in days between two dates +ok 952 — getDaysDiffBetweenDates is a Function +ok 953 — Returns the difference in days between two dates # PASS test/differenceWith.test.js -ok 956 — differenceWith is a Function -ok 957 — Filters out all values from an array +ok 954 — differenceWith is a Function +ok 955 — Filters out all values from an array # PASS test/countVowels.test.js -ok 958 — countVowels is a Function -ok 959 — countVowels returns the correct count -ok 960 — countVowels returns the correct count +ok 956 — countVowels is a Function +ok 957 — countVowels returns the correct count +ok 958 — countVowels returns the correct count # PASS test/partial.test.js -ok 961 — partial is a Function -ok 962 — Prepends arguments +ok 959 — partial is a Function +ok 960 — Prepends arguments # PASS test/size.test.js -ok 963 — size is a Function -ok 964 — Get size of arrays, objects or strings. -ok 965 — Get size of arrays, objects or strings. +ok 961 — size is a Function +ok 962 — Get size of arrays, objects or strings. +ok 963 — Get size of arrays, objects or strings. # PASS test/mapValues.test.js -ok 966 — mapValues is a Function -ok 967 — Maps values +ok 964 — mapValues is a Function +ok 965 — Maps values # PASS test/unionWith.test.js -ok 968 — unionWith is a Function -ok 969 — Produces the appropriate results +ok 966 — unionWith is a Function +ok 967 — Produces the appropriate results # PASS test/palindrome.test.js -ok 970 — palindrome is a Function -ok 971 — Given string is a palindrome -ok 972 — Given string is not a palindrome +ok 968 — palindrome is a Function +ok 969 — Given string is a palindrome +ok 970 — Given string is not a palindrome + +# PASS test/bindAll.test.js + +ok 971 — bindAll is a Function +ok 972 — Binds to an object context # PASS test/bifurcate.test.js @@ -1663,16 +1663,16 @@ ok 974 — Splits the collection into two groups ok 975 — bifurcateBy is a Function ok 976 — Splits the collection into two groups -# PASS test/attempt.test.js - -ok 977 — attempt is a Function -ok 978 — Returns a value -ok 979 — Returns an error - # PASS test/getColonTimeFromDate.test.js -ok 980 — getColonTimeFromDate is a Function -ok 981 — Gets the time in the proper format. +ok 977 — getColonTimeFromDate is a Function +ok 978 — Gets the time in the proper format. + +# PASS test/attempt.test.js + +ok 979 — attempt is a Function +ok 980 — Returns a value +ok 981 — Returns an error # PASS test/degreesToRads.test.js @@ -1714,26 +1714,26 @@ ok 995 — Flips argument order ok 996 — httpPut is a Function ok 997 — httpPut does not throw errors +# PASS test/httpGet.test.js + +ok 998 — httpGet is a Function +ok 999 — httpGet does not throw errors + # PASS test/dropRightWhile.test.js -ok 998 — dropRightWhile is a Function -ok 999 — Removes elements from the end of an array until the passed function returns true. +ok 1000 — dropRightWhile is a Function +ok 1001 — Removes elements from the end of an array until the passed function returns true. # PASS test/isSimilar.test.js -ok 1000 — isSimilar is a Function -ok 1001 — isSimilar returns true -ok 1002 — isSimilar returns false +ok 1002 — isSimilar is a Function +ok 1003 — isSimilar returns true +ok 1004 — isSimilar returns false # PASS test/get.test.js -ok 1003 — get is a Function -ok 1004 — Retrieve a property indicated by the selector from an object. - -# PASS test/httpGet.test.js - -ok 1005 — httpGet is a Function -ok 1006 — httpGet does not throw errors +ok 1005 — get is a Function +ok 1006 — Retrieve a property indicated by the selector from an object. # PASS test/omitBy.test.js @@ -2321,7 +2321,7 @@ ok 1234 — defer is a Function # Test Suites: 100% ██████████, 360 passed, 360 total # Tests: 100% ██████████, 1234 passed, 1234 total -# Time: 56.903s +# Time: 52.408s # Ran all test suites.