Travis build: 1308 [cron]
This commit is contained in:
44
dist/_30s.es5.js
vendored
44
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
20
dist/_30s.esm.js
vendored
20
dist/_30s.esm.js
vendored
@ -39,6 +39,8 @@ const anagrams = str => {
|
||||
const arrayToHtmlList = (arr, listID) =>
|
||||
arr.map(item => (document.querySelector('#' + listID).innerHTML += `<li>${item}</li>`));
|
||||
|
||||
const atob = str => new Buffer(str, 'base64').toString('binary');
|
||||
|
||||
const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length;
|
||||
|
||||
const averageBy = (arr, fn) =>
|
||||
@ -49,6 +51,8 @@ const bottomVisible = () =>
|
||||
document.documentElement.clientHeight + window.scrollY >=
|
||||
(document.documentElement.scrollHeight || document.documentElement.clientHeight);
|
||||
|
||||
const btoa = str => new Buffer(str, 'binary').toString('base64');
|
||||
|
||||
const byteSize = str => new Blob([str]).size;
|
||||
|
||||
const call = (key, ...args) => context => context[key](...args);
|
||||
@ -281,7 +285,7 @@ const flatten = (arr, depth = 1) =>
|
||||
? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flatten(v, depth - 1) : v), [])
|
||||
: arr.reduce((a, v) => a.concat(v), []);
|
||||
|
||||
const flip = fn => (...args) => fn(args.pop(), ...args);
|
||||
const flip = fn => (first, ...rest) => fn(...rest, first);
|
||||
|
||||
const forEachRight = (arr, callback) =>
|
||||
arr
|
||||
@ -328,6 +332,15 @@ const geometricProgression = (end, start = 1, step = 2) =>
|
||||
(v, i) => start * step ** i
|
||||
);
|
||||
|
||||
const get = (from, ...selectors) =>
|
||||
[...selectors].map(s =>
|
||||
s
|
||||
.replace(/\[([^\[\]]*)\]/g, '.$1.')
|
||||
.split('.')
|
||||
.filter(t => t !== '')
|
||||
.reduce((prev, cur) => prev && prev[cur], from)
|
||||
);
|
||||
|
||||
const getDaysDiffBetweenDates = (dateInitial, dateFinal) =>
|
||||
(dateFinal - dateInitial) / (1000 * 3600 * 24);
|
||||
|
||||
@ -874,9 +887,6 @@ const sdbm = str => {
|
||||
);
|
||||
};
|
||||
|
||||
const select = (from, ...selectors) =>
|
||||
[...selectors].map(s => s.split('.').reduce((prev, cur) => prev && prev[cur], from));
|
||||
|
||||
const serializeCookie = (name, val) => `${encodeURIComponent(name)}=${encodeURIComponent(val)}`;
|
||||
|
||||
const setStyle = (el, ruleName, val) => (el.style[ruleName] = val);
|
||||
@ -1044,6 +1054,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,average,averageBy,bottomVisible,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,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,select,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,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,}
|
||||
|
||||
export default imports;
|
||||
|
||||
20
dist/_30s.js
vendored
20
dist/_30s.js
vendored
@ -45,6 +45,8 @@ const anagrams = str => {
|
||||
const arrayToHtmlList = (arr, listID) =>
|
||||
arr.map(item => (document.querySelector('#' + listID).innerHTML += `<li>${item}</li>`));
|
||||
|
||||
const atob = str => new Buffer(str, 'base64').toString('binary');
|
||||
|
||||
const average = (...nums) => [...nums].reduce((acc, val) => acc + val, 0) / nums.length;
|
||||
|
||||
const averageBy = (arr, fn) =>
|
||||
@ -55,6 +57,8 @@ const bottomVisible = () =>
|
||||
document.documentElement.clientHeight + window.scrollY >=
|
||||
(document.documentElement.scrollHeight || document.documentElement.clientHeight);
|
||||
|
||||
const btoa = str => new Buffer(str, 'binary').toString('base64');
|
||||
|
||||
const byteSize = str => new Blob([str]).size;
|
||||
|
||||
const call = (key, ...args) => context => context[key](...args);
|
||||
@ -287,7 +291,7 @@ const flatten = (arr, depth = 1) =>
|
||||
? arr.reduce((a, v) => a.concat(Array.isArray(v) ? flatten(v, depth - 1) : v), [])
|
||||
: arr.reduce((a, v) => a.concat(v), []);
|
||||
|
||||
const flip = fn => (...args) => fn(args.pop(), ...args);
|
||||
const flip = fn => (first, ...rest) => fn(...rest, first);
|
||||
|
||||
const forEachRight = (arr, callback) =>
|
||||
arr
|
||||
@ -334,6 +338,15 @@ const geometricProgression = (end, start = 1, step = 2) =>
|
||||
(v, i) => start * step ** i
|
||||
);
|
||||
|
||||
const get = (from, ...selectors) =>
|
||||
[...selectors].map(s =>
|
||||
s
|
||||
.replace(/\[([^\[\]]*)\]/g, '.$1.')
|
||||
.split('.')
|
||||
.filter(t => t !== '')
|
||||
.reduce((prev, cur) => prev && prev[cur], from)
|
||||
);
|
||||
|
||||
const getDaysDiffBetweenDates = (dateInitial, dateFinal) =>
|
||||
(dateFinal - dateInitial) / (1000 * 3600 * 24);
|
||||
|
||||
@ -880,9 +893,6 @@ const sdbm = str => {
|
||||
);
|
||||
};
|
||||
|
||||
const select = (from, ...selectors) =>
|
||||
[...selectors].map(s => s.split('.').reduce((prev, cur) => prev && prev[cur], from));
|
||||
|
||||
const serializeCookie = (name, val) => `${encodeURIComponent(name)}=${encodeURIComponent(val)}`;
|
||||
|
||||
const setStyle = (el, ruleName, val) => (el.style[ruleName] = val);
|
||||
@ -1050,7 +1060,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,average,averageBy,bottomVisible,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,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,select,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,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,}
|
||||
|
||||
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/atob/atob.js
Normal file
2
test/atob/atob.js
Normal file
@ -0,0 +1,2 @@
|
||||
const atob = str => new Buffer(str, 'base64').toString('binary');
|
||||
module.exports = atob
|
||||
13
test/atob/atob.test.js
Normal file
13
test/atob/atob.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const atob = require('./atob.js');
|
||||
|
||||
test('Testing atob', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof atob === 'function', 'atob is a Function');
|
||||
//t.deepEqual(atob(args..), 'Expected');
|
||||
//t.equal(atob(args..), 'Expected');
|
||||
//t.false(atob(args..), 'Expected');
|
||||
//t.throws(atob(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
2
test/btoa/btoa.js
Normal file
2
test/btoa/btoa.js
Normal file
@ -0,0 +1,2 @@
|
||||
const btoa = str => new Buffer(str, 'binary').toString('base64');
|
||||
module.exports = btoa
|
||||
13
test/btoa/btoa.test.js
Normal file
13
test/btoa/btoa.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const test = require('tape');
|
||||
const btoa = require('./btoa.js');
|
||||
|
||||
test('Testing btoa', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof btoa === 'function', 'btoa is a Function');
|
||||
//t.deepEqual(btoa(args..), 'Expected');
|
||||
//t.equal(btoa(args..), 'Expected');
|
||||
//t.false(btoa(args..), 'Expected');
|
||||
//t.throws(btoa(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
@ -1,2 +1,2 @@
|
||||
const flip = fn => (...args) => fn(args.pop(), ...args);
|
||||
const flip = fn => (first, ...rest) => fn(...rest, first);
|
||||
module.exports = flip
|
||||
@ -1,9 +1,9 @@
|
||||
const get = (from, ...selectors) =>
|
||||
[...selectors].map(s =>
|
||||
s
|
||||
.replace(/\[([^\[\]]*)\]/g, '.$1.')
|
||||
.split('.')
|
||||
.filter(t => t !== '')
|
||||
.reduce((prev, cur) => prev && prev[cur], from)
|
||||
);
|
||||
module.exports = get
|
||||
[...selectors].map(s =>
|
||||
s
|
||||
.replace(/\[([^\[\]]*)\]/g, '.$1.')
|
||||
.split('.')
|
||||
.filter(t => t !== '')
|
||||
.reduce((prev, cur) => prev && prev[cur], from)
|
||||
);
|
||||
module.exports = get
|
||||
26
test/testlog
26
test/testlog
@ -1,4 +1,4 @@
|
||||
Test log for: Wed Jan 17 2018 20:11:11 GMT+0000 (UTC)
|
||||
Test log for: Thu Jan 18 2018 20:09:23 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
|
||||
@ -44,6 +44,10 @@ Test log for: Wed Jan 17 2018 20:11:11 GMT+0000 (UTC)
|
||||
|
||||
✔ arrayToHtmlList is a Function
|
||||
|
||||
Testing atob
|
||||
|
||||
✔ atob is a Function
|
||||
|
||||
Testing average
|
||||
|
||||
✔ average is a Function
|
||||
@ -71,6 +75,10 @@ Test log for: Wed Jan 17 2018 20:11:11 GMT+0000 (UTC)
|
||||
|
||||
✔ bottomVisible is a Function
|
||||
|
||||
Testing btoa
|
||||
|
||||
✔ btoa is a Function
|
||||
|
||||
Testing byteSize
|
||||
|
||||
✔ byteSize is a Function
|
||||
@ -360,6 +368,11 @@ Test log for: Wed Jan 17 2018 20:11:11 GMT+0000 (UTC)
|
||||
✔ Initializes an array containing the numbers in the specified range
|
||||
✔ Initializes an array containing the numbers in the specified range
|
||||
|
||||
Testing get
|
||||
|
||||
✔ get is a Function
|
||||
✔ Retrieve a property indicated by the selector from an object.
|
||||
|
||||
Testing getDaysDiffBetweenDates
|
||||
|
||||
✔ getDaysDiffBetweenDates is a Function
|
||||
@ -972,11 +985,6 @@ Test log for: Wed Jan 17 2018 20:11:11 GMT+0000 (UTC)
|
||||
✔ sdbm is a Function
|
||||
✔ Hashes the input string into a whole number.
|
||||
|
||||
Testing select
|
||||
|
||||
✔ select is a Function
|
||||
✔ Retrieve a property indicated by the selector from an object.
|
||||
|
||||
Testing serializeCookie
|
||||
|
||||
✔ serializeCookie is a Function
|
||||
@ -1261,8 +1269,8 @@ Test log for: Wed Jan 17 2018 20:11:11 GMT+0000 (UTC)
|
||||
✔ zipObject(test, string) throws an error
|
||||
|
||||
|
||||
total: 554
|
||||
passing: 554
|
||||
duration: 329ms
|
||||
total: 556
|
||||
passing: 556
|
||||
duration: 307ms
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user