Travis build: 1323 [cron]
This commit is contained in:
170
dist/_30s.es5.js
vendored
170
dist/_30s.es5.js
vendored
File diff suppressed because one or more lines are too long
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
39
dist/_30s.esm.js
vendored
39
dist/_30s.esm.js
vendored
@ -75,17 +75,6 @@ const chunk = (arr, size) =>
|
||||
|
||||
const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));
|
||||
|
||||
const cleanObj = (obj, keysToKeep = [], childIndicator) => {
|
||||
Object.keys(obj).forEach(key => {
|
||||
if (key === childIndicator) {
|
||||
cleanObj(obj[key], keysToKeep, childIndicator);
|
||||
} else if (!keysToKeep.includes(key)) {
|
||||
delete obj[key];
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
|
||||
const cloneRegExp = regExp => new RegExp(regExp.source, regExp.flags);
|
||||
|
||||
const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_));
|
||||
@ -174,6 +163,8 @@ const decapitalize = ([first, ...rest], upperRest = false) =>
|
||||
|
||||
const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v)));
|
||||
|
||||
const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
|
||||
|
||||
const defer = (fn, ...args) => setTimeout(fn, 1, ...args);
|
||||
|
||||
const detectDeviceType = () =>
|
||||
@ -293,6 +284,13 @@ const forEachRight = (arr, callback) =>
|
||||
.reverse()
|
||||
.forEach(callback);
|
||||
|
||||
const forOwn = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key, obj));
|
||||
|
||||
const forOwnRight = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.reverse()
|
||||
.forEach(key => fn(obj[key], key, obj));
|
||||
|
||||
const formatDuration = ms => {
|
||||
if (ms < 0) ms = -ms;
|
||||
const time = {
|
||||
@ -508,6 +506,8 @@ const isNumber = val => typeof val === 'number';
|
||||
|
||||
const isObject = obj => obj === Object(obj);
|
||||
|
||||
const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object;
|
||||
|
||||
const isPrime = num => {
|
||||
const boundary = Math.floor(Math.sqrt(num));
|
||||
for (var i = 2; i <= boundary; i++) if (num % i == 0) return false;
|
||||
@ -664,6 +664,16 @@ const observeMutations = (element, callback, options) => {
|
||||
|
||||
const off = (el, evt, fn, opts = false) => el.removeEventListener(evt, fn, opts);
|
||||
|
||||
const omit = (obj, arr) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => !arr.includes(k))
|
||||
.reduce((acc, key) => (acc[key] = obj[key], acc), {});
|
||||
|
||||
const omitBy = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => !fn(obj[k], k))
|
||||
.reduce((acc, key) => (acc[key] = obj[key], acc), {});
|
||||
|
||||
const on = (el, evt, fn, opts = {}) => {
|
||||
const delegatorFn = e => e.target.matches(opts.target) && fn.call(e.target, e);
|
||||
el.addEventListener(evt, opts.target ? delegatorFn : fn, opts.options || false);
|
||||
@ -740,6 +750,11 @@ const percentile = (arr, val) =>
|
||||
const pick = (obj, arr) =>
|
||||
arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), {});
|
||||
|
||||
const pickBy = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => fn(obj[k], k))
|
||||
.reduce((acc, key) => (acc[key] = obj[key], acc), {});
|
||||
|
||||
const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args)));
|
||||
|
||||
const pluralize = (val, word, plural = word + 's') => {
|
||||
@ -1054,6 +1069,6 @@ const zip = (...arrays) => {
|
||||
const zipObject = (props, values) =>
|
||||
props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {});
|
||||
|
||||
var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cleanObj,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,flatten,flip,forEachRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,}
|
||||
var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,flatten,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,}
|
||||
|
||||
export default imports;
|
||||
|
||||
39
dist/_30s.js
vendored
39
dist/_30s.js
vendored
@ -81,17 +81,6 @@ const chunk = (arr, size) =>
|
||||
|
||||
const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b));
|
||||
|
||||
const cleanObj = (obj, keysToKeep = [], childIndicator) => {
|
||||
Object.keys(obj).forEach(key => {
|
||||
if (key === childIndicator) {
|
||||
cleanObj(obj[key], keysToKeep, childIndicator);
|
||||
} else if (!keysToKeep.includes(key)) {
|
||||
delete obj[key];
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
|
||||
const cloneRegExp = regExp => new RegExp(regExp.source, regExp.flags);
|
||||
|
||||
const coalesce = (...args) => args.find(_ => ![undefined, null].includes(_));
|
||||
@ -180,6 +169,8 @@ const decapitalize = ([first, ...rest], upperRest = false) =>
|
||||
|
||||
const deepFlatten = arr => [].concat(...arr.map(v => (Array.isArray(v) ? deepFlatten(v) : v)));
|
||||
|
||||
const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
|
||||
|
||||
const defer = (fn, ...args) => setTimeout(fn, 1, ...args);
|
||||
|
||||
const detectDeviceType = () =>
|
||||
@ -299,6 +290,13 @@ const forEachRight = (arr, callback) =>
|
||||
.reverse()
|
||||
.forEach(callback);
|
||||
|
||||
const forOwn = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key, obj));
|
||||
|
||||
const forOwnRight = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.reverse()
|
||||
.forEach(key => fn(obj[key], key, obj));
|
||||
|
||||
const formatDuration = ms => {
|
||||
if (ms < 0) ms = -ms;
|
||||
const time = {
|
||||
@ -514,6 +512,8 @@ const isNumber = val => typeof val === 'number';
|
||||
|
||||
const isObject = obj => obj === Object(obj);
|
||||
|
||||
const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object;
|
||||
|
||||
const isPrime = num => {
|
||||
const boundary = Math.floor(Math.sqrt(num));
|
||||
for (var i = 2; i <= boundary; i++) if (num % i == 0) return false;
|
||||
@ -670,6 +670,16 @@ const observeMutations = (element, callback, options) => {
|
||||
|
||||
const off = (el, evt, fn, opts = false) => el.removeEventListener(evt, fn, opts);
|
||||
|
||||
const omit = (obj, arr) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => !arr.includes(k))
|
||||
.reduce((acc, key) => (acc[key] = obj[key], acc), {});
|
||||
|
||||
const omitBy = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => !fn(obj[k], k))
|
||||
.reduce((acc, key) => (acc[key] = obj[key], acc), {});
|
||||
|
||||
const on = (el, evt, fn, opts = {}) => {
|
||||
const delegatorFn = e => e.target.matches(opts.target) && fn.call(e.target, e);
|
||||
el.addEventListener(evt, opts.target ? delegatorFn : fn, opts.options || false);
|
||||
@ -746,6 +756,11 @@ const percentile = (arr, val) =>
|
||||
const pick = (obj, arr) =>
|
||||
arr.reduce((acc, curr) => (curr in obj && (acc[curr] = obj[curr]), acc), {});
|
||||
|
||||
const pickBy = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => fn(obj[k], k))
|
||||
.reduce((acc, key) => (acc[key] = obj[key], acc), {});
|
||||
|
||||
const pipeFunctions = (...fns) => fns.reduce((f, g) => (...args) => g(f(...args)));
|
||||
|
||||
const pluralize = (val, word, plural = word + 's') => {
|
||||
@ -1060,7 +1075,7 @@ const zip = (...arrays) => {
|
||||
const zipObject = (props, values) =>
|
||||
props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {});
|
||||
|
||||
var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cleanObj,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,flatten,flip,forEachRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,}
|
||||
var imports = {JSONToFile,RGBToHex,URLJoin,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,atob,average,averageBy,bottomVisible,btoa,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cloneRegExp,coalesce,coalesceFactory,collectInto,colorize,compact,compose,copyToClipboard,countBy,countOccurrences,createElement,createEventHub,currentURL,curry,decapitalize,deepFlatten,defaults,defer,detectDeviceType,difference,differenceWith,digitize,distance,dropElements,dropRight,elementIsVisibleInViewport,elo,equals,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,filterNonUnique,findLast,flatten,flip,forEachRight,forOwn,forOwnRight,formatDuration,fromCamelCase,functionName,functions,gcd,geometricProgression,get,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,hashBrowser,hashNode,head,hexToRGB,hide,httpGet,httpPost,httpsRedirect,inRange,indexOfAll,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithRangeRight,initializeArrayWithValues,intersection,invertKeyValues,is,isAbsoluteURL,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isLowerCase,isNil,isNull,isNumber,isObject,isPlainObject,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isUndefined,isUpperCase,isValidJSON,join,last,lcm,longestItem,lowercaseKeys,luhnCheck,mapKeys,mapObject,mapValues,mask,maxBy,maxN,median,memoize,merge,minBy,minN,negate,nthElement,objectFromPairs,objectToPairs,observeMutations,off,omit,omitBy,on,onUserInputChange,once,orderBy,palindrome,parseCookie,partition,percentile,pick,pickBy,pipeFunctions,pluralize,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,randomHexColorCode,randomIntArrayInRange,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,serializeCookie,setStyle,shallowClone,show,shuffle,similarity,size,sleep,sortCharactersInString,sortedIndex,splitLines,spreadOver,standardDeviation,sum,sumBy,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toKebabCase,toOrdinalSuffix,toSafeInteger,toSnakeCase,toggleClass,tomorrow,transform,truncateString,truthCheckCollection,unescapeHTML,union,uniqueElements,untildify,validateNumber,without,words,yesNo,zip,zipObject,}
|
||||
|
||||
return imports;
|
||||
|
||||
|
||||
2
dist/_30s.min.js
vendored
2
dist/_30s.min.js
vendored
File diff suppressed because one or more lines are too long
2
test/defaults/defaults.js
Normal file
2
test/defaults/defaults.js
Normal file
@ -0,0 +1,2 @@
|
||||
const defaults = (obj, ...defs) => Object.assign({}, obj, ...defs.reverse(), obj);
|
||||
module.exports = defaults
|
||||
13
test/defaults/defaults.test.js
Normal file
13
test/defaults/defaults.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const defaults = require('./defaults.js');
|
||||
|
||||
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(args..), 'Expected');
|
||||
//t.equal(defaults(args..), 'Expected');
|
||||
//t.false(defaults(args..), 'Expected');
|
||||
//t.throws(defaults(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
2
test/forOwn/forOwn.js
Normal file
2
test/forOwn/forOwn.js
Normal file
@ -0,0 +1,2 @@
|
||||
const forOwn = (obj, fn) => Object.keys(obj).forEach(key => fn(obj[key], key, obj));
|
||||
module.exports = forOwn
|
||||
13
test/forOwn/forOwn.test.js
Normal file
13
test/forOwn/forOwn.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const forOwn = require('./forOwn.js');
|
||||
|
||||
test('Testing forOwn', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof forOwn === 'function', 'forOwn is a Function');
|
||||
//t.deepEqual(forOwn(args..), 'Expected');
|
||||
//t.equal(forOwn(args..), 'Expected');
|
||||
//t.false(forOwn(args..), 'Expected');
|
||||
//t.throws(forOwn(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
5
test/forOwnRight/forOwnRight.js
Normal file
5
test/forOwnRight/forOwnRight.js
Normal file
@ -0,0 +1,5 @@
|
||||
const forOwnRight = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.reverse()
|
||||
.forEach(key => fn(obj[key], key, obj));
|
||||
module.exports = forOwnRight
|
||||
13
test/forOwnRight/forOwnRight.test.js
Normal file
13
test/forOwnRight/forOwnRight.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const forOwnRight = require('./forOwnRight.js');
|
||||
|
||||
test('Testing forOwnRight', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof forOwnRight === 'function', 'forOwnRight is a Function');
|
||||
//t.deepEqual(forOwnRight(args..), 'Expected');
|
||||
//t.equal(forOwnRight(args..), 'Expected');
|
||||
//t.false(forOwnRight(args..), 'Expected');
|
||||
//t.throws(forOwnRight(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
2
test/isPlainObject/isPlainObject.js
Normal file
2
test/isPlainObject/isPlainObject.js
Normal file
@ -0,0 +1,2 @@
|
||||
const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object;
|
||||
module.exports = isPlainObject
|
||||
13
test/isPlainObject/isPlainObject.test.js
Normal file
13
test/isPlainObject/isPlainObject.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const isPlainObject = require('./isPlainObject.js');
|
||||
|
||||
test('Testing isPlainObject', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof isPlainObject === 'function', 'isPlainObject is a Function');
|
||||
//t.deepEqual(isPlainObject(args..), 'Expected');
|
||||
//t.equal(isPlainObject(args..), 'Expected');
|
||||
//t.false(isPlainObject(args..), 'Expected');
|
||||
//t.throws(isPlainObject(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
5
test/omit/omit.js
Normal file
5
test/omit/omit.js
Normal file
@ -0,0 +1,5 @@
|
||||
const omit = (obj, arr) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => !arr.includes(k))
|
||||
.reduce((acc, key) => ((acc[key] = obj[key]), acc), {});
|
||||
module.exports = omit
|
||||
13
test/omit/omit.test.js
Normal file
13
test/omit/omit.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const omit = require('./omit.js');
|
||||
|
||||
test('Testing omit', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof omit === 'function', 'omit is a Function');
|
||||
//t.deepEqual(omit(args..), 'Expected');
|
||||
//t.equal(omit(args..), 'Expected');
|
||||
//t.false(omit(args..), 'Expected');
|
||||
//t.throws(omit(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
5
test/omitBy/omitBy.js
Normal file
5
test/omitBy/omitBy.js
Normal file
@ -0,0 +1,5 @@
|
||||
const omitBy = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => !fn(obj[k], k))
|
||||
.reduce((acc, key) => ((acc[key] = obj[key]), acc), {});
|
||||
module.exports = omitBy
|
||||
13
test/omitBy/omitBy.test.js
Normal file
13
test/omitBy/omitBy.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const omitBy = require('./omitBy.js');
|
||||
|
||||
test('Testing omitBy', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof omitBy === 'function', 'omitBy is a Function');
|
||||
//t.deepEqual(omitBy(args..), 'Expected');
|
||||
//t.equal(omitBy(args..), 'Expected');
|
||||
//t.false(omitBy(args..), 'Expected');
|
||||
//t.throws(omitBy(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
5
test/pickBy/pickBy.js
Normal file
5
test/pickBy/pickBy.js
Normal file
@ -0,0 +1,5 @@
|
||||
const pickBy = (obj, fn) =>
|
||||
Object.keys(obj)
|
||||
.filter(k => fn(obj[k], k))
|
||||
.reduce((acc, key) => ((acc[key] = obj[key]), acc), {});
|
||||
module.exports = pickBy
|
||||
13
test/pickBy/pickBy.test.js
Normal file
13
test/pickBy/pickBy.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const pickBy = require('./pickBy.js');
|
||||
|
||||
test('Testing pickBy', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof pickBy === 'function', 'pickBy is a Function');
|
||||
//t.deepEqual(pickBy(args..), 'Expected');
|
||||
//t.equal(pickBy(args..), 'Expected');
|
||||
//t.false(pickBy(args..), 'Expected');
|
||||
//t.throws(pickBy(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
36
test/testlog
36
test/testlog
@ -1,4 +1,4 @@
|
||||
Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC)
|
||||
Test log for: Fri Jan 19 2018 20:10:14 GMT+0000 (UTC)
|
||||
|
||||
> 30-seconds-of-code@0.0.1 test /home/travis/build/Chalarangelo/30-seconds-of-code
|
||||
> tape test/**/*.test.js | tap-spec
|
||||
@ -205,6 +205,10 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC)
|
||||
✔ deepFlatten is a Function
|
||||
✔ Deep flattens an array
|
||||
|
||||
Testing defaults
|
||||
|
||||
✔ defaults is a Function
|
||||
|
||||
Testing defer
|
||||
|
||||
✔ defer is a Function
|
||||
@ -334,6 +338,14 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC)
|
||||
|
||||
✔ forEachRight is a Function
|
||||
|
||||
Testing forOwn
|
||||
|
||||
✔ forOwn is a Function
|
||||
|
||||
Testing forOwnRight
|
||||
|
||||
✔ forOwnRight is a Function
|
||||
|
||||
Testing formatDuration
|
||||
|
||||
✔ formatDuration is a Function
|
||||
@ -605,6 +617,10 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC)
|
||||
✔ isObject({ a:1 }) is a object
|
||||
✔ isObject(true) is not a object
|
||||
|
||||
Testing isPlainObject
|
||||
|
||||
✔ isPlainObject is a Function
|
||||
|
||||
Testing isPrime
|
||||
|
||||
✔ isPrime is a Function
|
||||
@ -816,6 +832,14 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC)
|
||||
|
||||
✔ off is a Function
|
||||
|
||||
Testing omit
|
||||
|
||||
✔ omit is a Function
|
||||
|
||||
Testing omitBy
|
||||
|
||||
✔ omitBy is a Function
|
||||
|
||||
Testing on
|
||||
|
||||
✔ on is a Function
|
||||
@ -859,6 +883,10 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC)
|
||||
✔ pick is a Function
|
||||
✔ Picks the key-value pairs corresponding to the given keys from an object.
|
||||
|
||||
Testing pickBy
|
||||
|
||||
✔ pickBy is a Function
|
||||
|
||||
Testing pipeFunctions
|
||||
|
||||
✔ pipeFunctions is a Function
|
||||
@ -1269,8 +1297,8 @@ Test log for: Thu Jan 18 2018 20:09:23 GMT+0000 (UTC)
|
||||
✔ zipObject(test, string) throws an error
|
||||
|
||||
|
||||
total: 556
|
||||
passing: 556
|
||||
duration: 307ms
|
||||
total: 563
|
||||
passing: 563
|
||||
duration: 311ms
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user