Travis Build: 866 [api]

This commit is contained in:
Angelos Chalaris
2018-01-02 21:41:13 +02:00
parent 38b63c8f8f
commit c6911fa1fd
7 changed files with 2252 additions and 2250 deletions

View File

@ -11,6 +11,8 @@ commit_website_files() {
git add * git add *
if [ $TRAVIS_EVENT_TYPE == "cron" ]; then if [ $TRAVIS_EVENT_TYPE == "cron" ]; then
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]" git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]"
elif [ $TRAVIS_EVENT_TYPE == "api" ]; then
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [custom]"
else else
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER" git commit --message "Travis build: $TRAVIS_BUILD_NUMBER"
fi fi

114
dist/_30s.es5.js vendored
View File

@ -4,33 +4,6 @@
(global._30s = factory()); (global._30s = factory());
}(this, (function () { 'use strict'; }(this, (function () { 'use strict';
var JSONToDate = function JSONToDate(arr) {
var dt = new Date(parseInt(arr.toString().substr(6)));
return dt.getDate() + "/" + (dt.getMonth() + 1) + "/" + dt.getFullYear();
};
var fs = typeof require !== "undefined" && require('fs');
var JSONToFile = function JSONToFile(obj, filename) {
return fs.writeFile(filename + ".json", JSON.stringify(obj, null, 2));
};
var RGBToHex = function RGBToHex(r, g, b) {
return ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
};
var UUIDGeneratorBrowser = function UUIDGeneratorBrowser() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {
return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);
});
};
var crypto$1 = typeof require !== "undefined" && require('crypto');
var UUIDGeneratorNode = function UUIDGeneratorNode() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {
return (c ^ crypto$1.randomBytes(1)[0] & 15 >> c / 4).toString(16);
});
};
var anagrams = function anagrams(str) { var anagrams = function anagrams(str) {
if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str]; if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
return str.split('').reduce(function (acc, letter, i) { return str.split('').reduce(function (acc, letter, i) {
@ -505,13 +478,6 @@ var httpsRedirect = function httpsRedirect() {
if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]); if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
}; };
var inRange = function inRange(n, start) {
var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (end && start > end) end = [start, start = end][0];
return end == null ? n >= 0 && n < start : n >= start && n < end;
};
var initial = function initial(arr) { var initial = function initial(arr) {
return arr.slice(0, -1); return arr.slice(0, -1);
}; };
@ -535,6 +501,13 @@ var initializeArrayWithValues = function initializeArrayWithValues(n) {
return Array(n).fill(value); return Array(n).fill(value);
}; };
var inRange = function inRange(n, start) {
var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (end && start > end) end = [start, start = end][0];
return end == null ? n >= 0 && n < start : n >= start && n < end;
};
var intersection = function intersection(a, b) { var intersection = function intersection(a, b) {
var s = new Set(b); var s = new Set(b);
return a.filter(function (x) { return a.filter(function (x) {
@ -685,6 +658,16 @@ var join = function join(arr) {
}, ''); }, '');
}; };
var JSONToDate = function JSONToDate(arr) {
var dt = new Date(parseInt(arr.toString().substr(6)));
return dt.getDate() + "/" + (dt.getMonth() + 1) + "/" + dt.getFullYear();
};
var fs = typeof require !== "undefined" && require('fs');
var JSONToFile = function JSONToFile(obj, filename) {
return fs.writeFile(filename + ".json", JSON.stringify(obj, null, 2));
};
var last = function last(arr) { var last = function last(arr) {
return arr[arr.length - 1]; return arr[arr.length - 1];
}; };
@ -780,20 +763,6 @@ var objectToPairs = function objectToPairs(obj) {
}); });
}; };
var onUserInputChange = function onUserInputChange(callback) {
var type = 'mouse',
lastTime = 0;
var mousemoveHandler = function mousemoveHandler() {
var now = performance.now();
if (now - lastTime < 20) type = 'mouse', callback(type), document.removeEventListener('mousemove', mousemoveHandler);
lastTime = now;
};
document.addEventListener('touchstart', function () {
if (type === 'touch') return;
type = 'touch', callback(type), document.addEventListener('mousemove', mousemoveHandler);
});
};
var once = function once(fn) { var once = function once(fn) {
var called = false; var called = false;
return function () { return function () {
@ -808,6 +777,20 @@ var once = function once(fn) {
}; };
}; };
var onUserInputChange = function onUserInputChange(callback) {
var type = 'mouse',
lastTime = 0;
var mousemoveHandler = function mousemoveHandler() {
var now = performance.now();
if (now - lastTime < 20) type = 'mouse', callback(type), document.removeEventListener('mousemove', mousemoveHandler);
lastTime = now;
};
document.addEventListener('touchstart', function () {
if (type === 'touch') return;
type = 'touch', callback(type), document.addEventListener('mousemove', mousemoveHandler);
});
};
var _slicedToArray$2 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _slicedToArray$2 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
function _toConsumableArray$9(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _toConsumableArray$9(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
@ -1016,6 +999,10 @@ var reverseString = function reverseString(str) {
return str.split('').reverse().join(''); return str.split('').reverse().join('');
}; };
var RGBToHex = function RGBToHex(r, g, b) {
return ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
};
var round = function round(n) { var round = function round(n) {
var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var decimals = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
return Number(Math.round(n + "e" + decimals) + "e-" + decimals); return Number(Math.round(n + "e" + decimals) + "e-" + decimals);
@ -1292,12 +1279,20 @@ var toEnglishDate = function toEnglishDate(time) {
} catch (e) {} } catch (e) {}
}; };
var toggleClass = function toggleClass(el, className) {
return el.classList.toggle(className);
};
var toKebabCase = function toKebabCase(str) { var toKebabCase = function toKebabCase(str) {
return str && str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map(function (x) { return str && str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map(function (x) {
return x.toLowerCase(); return x.toLowerCase();
}).join('-'); }).join('-');
}; };
var tomorrow = function tomorrow() {
return new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
};
var toOrdinalSuffix = function toOrdinalSuffix(num) { var toOrdinalSuffix = function toOrdinalSuffix(num) {
var int = parseInt(num), var int = parseInt(num),
digits = [int % 10, int % 100], digits = [int % 10, int % 100],
@ -1313,14 +1308,6 @@ var toSnakeCase = function toSnakeCase(str) {
}).join('_'); }).join('_');
}; };
var toggleClass = function toggleClass(el, className) {
return el.classList.toggle(className);
};
var tomorrow = function tomorrow() {
return new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
};
var truncateString = function truncateString(str, num) { var truncateString = function truncateString(str, num) {
return str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str; return str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
}; };
@ -1353,6 +1340,19 @@ var untildify = function untildify(str) {
return str.replace(/^~($|\/|\\)/, (typeof require !== "undefined" && require('os').homedir()) + "$1"); return str.replace(/^~($|\/|\\)/, (typeof require !== "undefined" && require('os').homedir()) + "$1");
}; };
var UUIDGeneratorBrowser = function UUIDGeneratorBrowser() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {
return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);
});
};
var crypto$1 = typeof require !== "undefined" && require('crypto');
var UUIDGeneratorNode = function UUIDGeneratorNode() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {
return (c ^ crypto$1.randomBytes(1)[0] & 15 >> c / 4).toString(16);
});
};
var validateNumber = function validateNumber(n) { var validateNumber = function validateNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n; return !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
}; };
@ -1401,7 +1401,7 @@ var zipObject = function zipObject(props, values) {
}, {}); }, {});
}; };
var imports = { JSONToDate: JSONToDate, JSONToFile: JSONToFile, RGBToHex: RGBToHex, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, average: average, bottomVisible: bottomVisible, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cleanObj: cleanObj, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collatz: collatz, collectInto: collectInto, compact: compact, compose: compose, copyToClipboard: copyToClipboard, countOccurrences: countOccurrences, countVowels: countVowels, currentURL: currentURL, curry: curry, deepFlatten: deepFlatten, defer: defer, detectDeviceType: detectDeviceType, difference: difference, differenceWith: differenceWith, digitize: digitize, distance: distance, distinctValuesOfArray: distinctValuesOfArray, dropElements: dropElements, dropRight: dropRight, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, fibonacciCountUntilNum: fibonacciCountUntilNum, fibonacciUntilNum: fibonacciUntilNum, filterNonUnique: filterNonUnique, flatten: flatten, flattenDepth: flattenDepth, flip: flip, fromCamelCase: fromCamelCase, functionName: functionName, gcd: gcd, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, head: head, hexToRGB: hexToRGB, hide: hide, httpsRedirect: httpsRedirect, inRange: inRange, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithValues: initializeArrayWithValues, intersection: intersection, invertKeyValues: invertKeyValues, isAbsoluteURL: isAbsoluteURL, isArmstrongNumber: isArmstrongNumber, isArray: isArray, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEven: isEven, isFunction: isFunction, isNull: isNull, isNumber: isNumber, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isValidJSON: isValidJSON, join: join, last: last, lcm: lcm, lowercaseKeys: lowercaseKeys, mapObject: mapObject, mask: mask, max: max, median: median, memoize: memoize, min: min, negate: negate, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, onUserInputChange: onUserInputChange, once: once, orderBy: orderBy, palindrome: palindrome, percentile: percentile, pick: pick, pipeFunctions: pipeFunctions, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, quickSort: quickSort, randomHexColorCode: randomHexColorCode, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, redirect: redirect, reducedFilter: reducedFilter, remove: remove, repeatString: repeatString, reverseString: reverseString, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, select: select, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, solveRPN: solveRPN, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, speechSynthesis: speechSynthesis, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, sum: sum, sumPower: sumPower, symmetricDifference: symmetricDifference, tail: tail, take: take, takeRight: takeRight, timeTaken: timeTaken, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toEnglishDate: toEnglishDate, toKebabCase: toKebabCase, toOrdinalSuffix: toOrdinalSuffix, toSnakeCase: toSnakeCase, toggleClass: toggleClass, tomorrow: tomorrow, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unescapeHTML: unescapeHTML, union: union, untildify: untildify, validateNumber: validateNumber, without: without, words: words, yesNo: yesNo, zip: zip, zipObject: zipObject }; var imports = { anagrams: anagrams, arrayToHtmlList: arrayToHtmlList, average: average, bottomVisible: bottomVisible, byteSize: byteSize, call: call, capitalize: capitalize, capitalizeEveryWord: capitalizeEveryWord, chainAsync: chainAsync, chunk: chunk, clampNumber: clampNumber, cleanObj: cleanObj, cloneRegExp: cloneRegExp, coalesce: coalesce, coalesceFactory: coalesceFactory, collatz: collatz, collectInto: collectInto, compact: compact, compose: compose, copyToClipboard: copyToClipboard, countOccurrences: countOccurrences, countVowels: countVowels, currentURL: currentURL, curry: curry, deepFlatten: deepFlatten, defer: defer, detectDeviceType: detectDeviceType, difference: difference, differenceWith: differenceWith, digitize: digitize, distance: distance, distinctValuesOfArray: distinctValuesOfArray, dropElements: dropElements, dropRight: dropRight, elementIsVisibleInViewport: elementIsVisibleInViewport, elo: elo, escapeHTML: escapeHTML, escapeRegExp: escapeRegExp, everyNth: everyNth, extendHex: extendHex, factorial: factorial, fibonacci: fibonacci, fibonacciCountUntilNum: fibonacciCountUntilNum, fibonacciUntilNum: fibonacciUntilNum, filterNonUnique: filterNonUnique, flatten: flatten, flattenDepth: flattenDepth, flip: flip, fromCamelCase: fromCamelCase, functionName: functionName, gcd: gcd, getDaysDiffBetweenDates: getDaysDiffBetweenDates, getScrollPosition: getScrollPosition, getStyle: getStyle, getType: getType, getURLParameters: getURLParameters, groupBy: groupBy, hammingDistance: hammingDistance, hasClass: hasClass, hasFlags: hasFlags, head: head, hexToRGB: hexToRGB, hide: hide, httpsRedirect: httpsRedirect, initial: initial, initialize2DArray: initialize2DArray, initializeArrayWithRange: initializeArrayWithRange, initializeArrayWithValues: initializeArrayWithValues, inRange: inRange, intersection: intersection, invertKeyValues: invertKeyValues, isAbsoluteURL: isAbsoluteURL, isArmstrongNumber: isArmstrongNumber, isArray: isArray, isArrayLike: isArrayLike, isBoolean: isBoolean, isDivisible: isDivisible, isEven: isEven, isFunction: isFunction, isNull: isNull, isNumber: isNumber, isPrime: isPrime, isPrimitive: isPrimitive, isPromiseLike: isPromiseLike, isSorted: isSorted, isString: isString, isSymbol: isSymbol, isTravisCI: isTravisCI, isValidJSON: isValidJSON, join: join, JSONToDate: JSONToDate, JSONToFile: JSONToFile, last: last, lcm: lcm, lowercaseKeys: lowercaseKeys, mapObject: mapObject, mask: mask, max: max, median: median, memoize: memoize, min: min, negate: negate, nthElement: nthElement, objectFromPairs: objectFromPairs, objectToPairs: objectToPairs, once: once, onUserInputChange: onUserInputChange, orderBy: orderBy, palindrome: palindrome, percentile: percentile, pick: pick, pipeFunctions: pipeFunctions, powerset: powerset, prettyBytes: prettyBytes, primes: primes, promisify: promisify, pull: pull, pullAtIndex: pullAtIndex, pullAtValue: pullAtValue, quickSort: quickSort, randomHexColorCode: randomHexColorCode, randomIntegerInRange: randomIntegerInRange, randomNumberInRange: randomNumberInRange, readFileLines: readFileLines, redirect: redirect, reducedFilter: reducedFilter, remove: remove, repeatString: repeatString, reverseString: reverseString, RGBToHex: RGBToHex, round: round, runAsync: runAsync, runPromisesInSeries: runPromisesInSeries, sample: sample, sampleSize: sampleSize, scrollToTop: scrollToTop, sdbm: sdbm, select: select, setStyle: setStyle, shallowClone: shallowClone, show: show, shuffle: shuffle, similarity: similarity, size: size, sleep: sleep, solveRPN: solveRPN, sortCharactersInString: sortCharactersInString, sortedIndex: sortedIndex, speechSynthesis: speechSynthesis, splitLines: splitLines, spreadOver: spreadOver, standardDeviation: standardDeviation, sum: sum, sumPower: sumPower, symmetricDifference: symmetricDifference, tail: tail, take: take, takeRight: takeRight, timeTaken: timeTaken, toCamelCase: toCamelCase, toDecimalMark: toDecimalMark, toEnglishDate: toEnglishDate, toggleClass: toggleClass, toKebabCase: toKebabCase, tomorrow: tomorrow, toOrdinalSuffix: toOrdinalSuffix, toSnakeCase: toSnakeCase, truncateString: truncateString, truthCheckCollection: truthCheckCollection, unescapeHTML: unescapeHTML, union: union, untildify: untildify, UUIDGeneratorBrowser: UUIDGeneratorBrowser, UUIDGeneratorNode: UUIDGeneratorNode, validateNumber: validateNumber, without: without, words: words, yesNo: yesNo, zip: zip, zipObject: zipObject };
return imports; return imports;

File diff suppressed because one or more lines are too long

82
dist/_30s.esm.js vendored
View File

@ -1,25 +1,3 @@
const JSONToDate = arr => {
const dt = new Date(parseInt(arr.toString().substr(6)));
return `${dt.getDate()}/${dt.getMonth() + 1}/${dt.getFullYear()}`;
};
const fs = typeof require !== "undefined" && require('fs');
const JSONToFile = (obj, filename) =>
fs.writeFile(`${filename}.json`, JSON.stringify(obj, null, 2));
const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
const UUIDGeneratorBrowser = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
);
const crypto$1 = typeof require !== "undefined" && require('crypto');
const UUIDGeneratorNode = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
);
const anagrams = str => { const anagrams = str => {
if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str]; if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
return str return str
@ -294,11 +272,6 @@ const httpsRedirect = () => {
if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]); if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
}; };
const inRange = (n, start, end = null) => {
if (end && start > end) end = [start, (start = end)][0];
return end == null ? n >= 0 && n < start : n >= start && n < end;
};
const initial = arr => arr.slice(0, -1); const initial = arr => arr.slice(0, -1);
const initialize2DArray = (w, h, val = null) => const initialize2DArray = (w, h, val = null) =>
@ -311,6 +284,11 @@ const initializeArrayWithRange = (end, start = 0) =>
const initializeArrayWithValues = (n, value = 0) => Array(n).fill(value); const initializeArrayWithValues = (n, value = 0) => Array(n).fill(value);
const inRange = (n, start, end = null) => {
if (end && start > end) end = [start, (start = end)][0];
return end == null ? n >= 0 && n < start : n >= start && n < end;
};
const intersection = (a, b) => { const intersection = (a, b) => {
const s = new Set(b); const s = new Set(b);
return a.filter(x => s.has(x)); return a.filter(x => s.has(x));
@ -395,6 +373,15 @@ const join = (arr, separator = ',', end = separator) =>
'' ''
); );
const JSONToDate = arr => {
const dt = new Date(parseInt(arr.toString().substr(6)));
return `${dt.getDate()}/${dt.getMonth() + 1}/${dt.getFullYear()}`;
};
const fs = typeof require !== "undefined" && require('fs');
const JSONToFile = (obj, filename) =>
fs.writeFile(`${filename}.json`, JSON.stringify(obj, null, 2));
const last = arr => arr[arr.length - 1]; const last = arr => arr[arr.length - 1];
const lcm = (...arr) => { const lcm = (...arr) => {
@ -439,6 +426,15 @@ const objectFromPairs = arr => arr.reduce((a, v) => (a[v[0]] = v[1], a), {});
const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]); const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]);
const once = fn => {
let called = false;
return function(...args) {
if (called) return;
called = true;
return fn.apply(this, args);
};
};
const onUserInputChange = callback => { const onUserInputChange = callback => {
let type = 'mouse', let type = 'mouse',
lastTime = 0; lastTime = 0;
@ -454,15 +450,6 @@ const onUserInputChange = callback => {
}); });
}; };
const once = fn => {
let called = false;
return function(...args) {
if (called) return;
called = true;
return fn.apply(this, args);
};
};
const orderBy = (arr, props, orders) => const orderBy = (arr, props, orders) =>
[...arr].sort((a, b) => [...arr].sort((a, b) =>
props.reduce((acc, prop, i) => { props.reduce((acc, prop, i) => {
@ -596,6 +583,8 @@ const reverseString = str =>
.reverse() .reverse()
.join(''); .join('');
const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`); const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`);
const runAsync = fn => { const runAsync = fn => {
@ -784,6 +773,8 @@ const toEnglishDate = time => {
} catch (e) {} } catch (e) {}
}; };
const toggleClass = (el, className) => el.classList.toggle(className);
const toKebabCase = str => const toKebabCase = str =>
str && str &&
str str
@ -791,6 +782,8 @@ const toKebabCase = str =>
.map(x => x.toLowerCase()) .map(x => x.toLowerCase())
.join('-'); .join('-');
const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
const toOrdinalSuffix = num => { const toOrdinalSuffix = num => {
const int = parseInt(num), const int = parseInt(num),
digits = [int % 10, int % 100], digits = [int % 10, int % 100],
@ -809,10 +802,6 @@ const toSnakeCase = str =>
.map(x => x.toLowerCase()) .map(x => x.toLowerCase())
.join('_'); .join('_');
const toggleClass = (el, className) => el.classList.toggle(className);
const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
const truncateString = (str, num) => const truncateString = (str, num) =>
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str; str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
@ -835,6 +824,17 @@ const union = (a, b) => Array.from(new Set([...a, ...b]));
const untildify = str => str.replace(/^~($|\/|\\)/, `${typeof require !== "undefined" && require('os').homedir()}$1`); const untildify = str => str.replace(/^~($|\/|\\)/, `${typeof require !== "undefined" && require('os').homedir()}$1`);
const UUIDGeneratorBrowser = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
);
const crypto$1 = typeof require !== "undefined" && require('crypto');
const UUIDGeneratorNode = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
);
const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n; const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
const without = (arr, ...args) => arr.filter(v => !args.includes(v)); const without = (arr, ...args) => arr.filter(v => !args.includes(v));
@ -854,6 +854,6 @@ const zip = (...arrays) => {
const zipObject = (props, values) => const zipObject = (props, values) =>
props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {}); props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {});
var imports = {JSONToDate,JSONToFile,RGBToHex,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,average,bottomVisible,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cleanObj,cloneRegExp,coalesce,coalesceFactory,collatz,collectInto,compact,compose,copyToClipboard,countOccurrences,countVowels,currentURL,curry,deepFlatten,defer,detectDeviceType,difference,differenceWith,digitize,distance,distinctValuesOfArray,dropElements,dropRight,elementIsVisibleInViewport,elo,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,fibonacciCountUntilNum,fibonacciUntilNum,filterNonUnique,flatten,flattenDepth,flip,fromCamelCase,functionName,gcd,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,head,hexToRGB,hide,httpsRedirect,inRange,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithValues,intersection,invertKeyValues,isAbsoluteURL,isArmstrongNumber,isArray,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isNull,isNumber,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isValidJSON,join,last,lcm,lowercaseKeys,mapObject,mask,max,median,memoize,min,negate,nthElement,objectFromPairs,objectToPairs,onUserInputChange,once,orderBy,palindrome,percentile,pick,pipeFunctions,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,quickSort,randomHexColorCode,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,repeatString,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,select,setStyle,shallowClone,show,shuffle,similarity,size,sleep,solveRPN,sortCharactersInString,sortedIndex,speechSynthesis,splitLines,spreadOver,standardDeviation,sum,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toEnglishDate,toKebabCase,toOrdinalSuffix,toSnakeCase,toggleClass,tomorrow,truncateString,truthCheckCollection,unescapeHTML,union,untildify,validateNumber,without,words,yesNo,zip,zipObject,} var imports = {anagrams,arrayToHtmlList,average,bottomVisible,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cleanObj,cloneRegExp,coalesce,coalesceFactory,collatz,collectInto,compact,compose,copyToClipboard,countOccurrences,countVowels,currentURL,curry,deepFlatten,defer,detectDeviceType,difference,differenceWith,digitize,distance,distinctValuesOfArray,dropElements,dropRight,elementIsVisibleInViewport,elo,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,fibonacciCountUntilNum,fibonacciUntilNum,filterNonUnique,flatten,flattenDepth,flip,fromCamelCase,functionName,gcd,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,head,hexToRGB,hide,httpsRedirect,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithValues,inRange,intersection,invertKeyValues,isAbsoluteURL,isArmstrongNumber,isArray,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isNull,isNumber,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isValidJSON,join,JSONToDate,JSONToFile,last,lcm,lowercaseKeys,mapObject,mask,max,median,memoize,min,negate,nthElement,objectFromPairs,objectToPairs,once,onUserInputChange,orderBy,palindrome,percentile,pick,pipeFunctions,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,quickSort,randomHexColorCode,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,repeatString,reverseString,RGBToHex,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,select,setStyle,shallowClone,show,shuffle,similarity,size,sleep,solveRPN,sortCharactersInString,sortedIndex,speechSynthesis,splitLines,spreadOver,standardDeviation,sum,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toEnglishDate,toggleClass,toKebabCase,tomorrow,toOrdinalSuffix,toSnakeCase,truncateString,truthCheckCollection,unescapeHTML,union,untildify,UUIDGeneratorBrowser,UUIDGeneratorNode,validateNumber,without,words,yesNo,zip,zipObject,}
export default imports; export default imports;

82
dist/_30s.js vendored
View File

@ -4,28 +4,6 @@
(global._30s = factory()); (global._30s = factory());
}(this, (function () { 'use strict'; }(this, (function () { 'use strict';
const JSONToDate = arr => {
const dt = new Date(parseInt(arr.toString().substr(6)));
return `${dt.getDate()}/${dt.getMonth() + 1}/${dt.getFullYear()}`;
};
const fs = typeof require !== "undefined" && require('fs');
const JSONToFile = (obj, filename) =>
fs.writeFile(`${filename}.json`, JSON.stringify(obj, null, 2));
const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
const UUIDGeneratorBrowser = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
);
const crypto$1 = typeof require !== "undefined" && require('crypto');
const UUIDGeneratorNode = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
);
const anagrams = str => { const anagrams = str => {
if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str]; if (str.length <= 2) return str.length === 2 ? [str, str[1] + str[0]] : [str];
return str return str
@ -300,11 +278,6 @@ const httpsRedirect = () => {
if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]); if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
}; };
const inRange = (n, start, end = null) => {
if (end && start > end) end = [start, (start = end)][0];
return end == null ? n >= 0 && n < start : n >= start && n < end;
};
const initial = arr => arr.slice(0, -1); const initial = arr => arr.slice(0, -1);
const initialize2DArray = (w, h, val = null) => const initialize2DArray = (w, h, val = null) =>
@ -317,6 +290,11 @@ const initializeArrayWithRange = (end, start = 0) =>
const initializeArrayWithValues = (n, value = 0) => Array(n).fill(value); const initializeArrayWithValues = (n, value = 0) => Array(n).fill(value);
const inRange = (n, start, end = null) => {
if (end && start > end) end = [start, (start = end)][0];
return end == null ? n >= 0 && n < start : n >= start && n < end;
};
const intersection = (a, b) => { const intersection = (a, b) => {
const s = new Set(b); const s = new Set(b);
return a.filter(x => s.has(x)); return a.filter(x => s.has(x));
@ -401,6 +379,15 @@ const join = (arr, separator = ',', end = separator) =>
'' ''
); );
const JSONToDate = arr => {
const dt = new Date(parseInt(arr.toString().substr(6)));
return `${dt.getDate()}/${dt.getMonth() + 1}/${dt.getFullYear()}`;
};
const fs = typeof require !== "undefined" && require('fs');
const JSONToFile = (obj, filename) =>
fs.writeFile(`${filename}.json`, JSON.stringify(obj, null, 2));
const last = arr => arr[arr.length - 1]; const last = arr => arr[arr.length - 1];
const lcm = (...arr) => { const lcm = (...arr) => {
@ -445,6 +432,15 @@ const objectFromPairs = arr => arr.reduce((a, v) => (a[v[0]] = v[1], a), {});
const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]); const objectToPairs = obj => Object.keys(obj).map(k => [k, obj[k]]);
const once = fn => {
let called = false;
return function(...args) {
if (called) return;
called = true;
return fn.apply(this, args);
};
};
const onUserInputChange = callback => { const onUserInputChange = callback => {
let type = 'mouse', let type = 'mouse',
lastTime = 0; lastTime = 0;
@ -460,15 +456,6 @@ const onUserInputChange = callback => {
}); });
}; };
const once = fn => {
let called = false;
return function(...args) {
if (called) return;
called = true;
return fn.apply(this, args);
};
};
const orderBy = (arr, props, orders) => const orderBy = (arr, props, orders) =>
[...arr].sort((a, b) => [...arr].sort((a, b) =>
props.reduce((acc, prop, i) => { props.reduce((acc, prop, i) => {
@ -602,6 +589,8 @@ const reverseString = str =>
.reverse() .reverse()
.join(''); .join('');
const RGBToHex = (r, g, b) => ((r << 16) + (g << 8) + b).toString(16).padStart(6, '0');
const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`); const round = (n, decimals = 0) => Number(`${Math.round(`${n}e${decimals}`)}e-${decimals}`);
const runAsync = fn => { const runAsync = fn => {
@ -790,6 +779,8 @@ const toEnglishDate = time => {
} catch (e) {} } catch (e) {}
}; };
const toggleClass = (el, className) => el.classList.toggle(className);
const toKebabCase = str => const toKebabCase = str =>
str && str &&
str str
@ -797,6 +788,8 @@ const toKebabCase = str =>
.map(x => x.toLowerCase()) .map(x => x.toLowerCase())
.join('-'); .join('-');
const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
const toOrdinalSuffix = num => { const toOrdinalSuffix = num => {
const int = parseInt(num), const int = parseInt(num),
digits = [int % 10, int % 100], digits = [int % 10, int % 100],
@ -815,10 +808,6 @@ const toSnakeCase = str =>
.map(x => x.toLowerCase()) .map(x => x.toLowerCase())
.join('_'); .join('_');
const toggleClass = (el, className) => el.classList.toggle(className);
const tomorrow = () => new Date(new Date().getTime() + 86400000).toISOString().split('T')[0];
const truncateString = (str, num) => const truncateString = (str, num) =>
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str; str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
@ -841,6 +830,17 @@ const union = (a, b) => Array.from(new Set([...a, ...b]));
const untildify = str => str.replace(/^~($|\/|\\)/, `${typeof require !== "undefined" && require('os').homedir()}$1`); const untildify = str => str.replace(/^~($|\/|\\)/, `${typeof require !== "undefined" && require('os').homedir()}$1`);
const UUIDGeneratorBrowser = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)
);
const crypto$1 = typeof require !== "undefined" && require('crypto');
const UUIDGeneratorNode = () =>
([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ (crypto$1.randomBytes(1)[0] & (15 >> (c / 4)))).toString(16)
);
const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n; const validateNumber = n => !isNaN(parseFloat(n)) && isFinite(n) && Number(n) == n;
const without = (arr, ...args) => arr.filter(v => !args.includes(v)); const without = (arr, ...args) => arr.filter(v => !args.includes(v));
@ -860,7 +860,7 @@ const zip = (...arrays) => {
const zipObject = (props, values) => const zipObject = (props, values) =>
props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {}); props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {});
var imports = {JSONToDate,JSONToFile,RGBToHex,UUIDGeneratorBrowser,UUIDGeneratorNode,anagrams,arrayToHtmlList,average,bottomVisible,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cleanObj,cloneRegExp,coalesce,coalesceFactory,collatz,collectInto,compact,compose,copyToClipboard,countOccurrences,countVowels,currentURL,curry,deepFlatten,defer,detectDeviceType,difference,differenceWith,digitize,distance,distinctValuesOfArray,dropElements,dropRight,elementIsVisibleInViewport,elo,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,fibonacciCountUntilNum,fibonacciUntilNum,filterNonUnique,flatten,flattenDepth,flip,fromCamelCase,functionName,gcd,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,head,hexToRGB,hide,httpsRedirect,inRange,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithValues,intersection,invertKeyValues,isAbsoluteURL,isArmstrongNumber,isArray,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isNull,isNumber,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isValidJSON,join,last,lcm,lowercaseKeys,mapObject,mask,max,median,memoize,min,negate,nthElement,objectFromPairs,objectToPairs,onUserInputChange,once,orderBy,palindrome,percentile,pick,pipeFunctions,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,quickSort,randomHexColorCode,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,repeatString,reverseString,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,select,setStyle,shallowClone,show,shuffle,similarity,size,sleep,solveRPN,sortCharactersInString,sortedIndex,speechSynthesis,splitLines,spreadOver,standardDeviation,sum,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toEnglishDate,toKebabCase,toOrdinalSuffix,toSnakeCase,toggleClass,tomorrow,truncateString,truthCheckCollection,unescapeHTML,union,untildify,validateNumber,without,words,yesNo,zip,zipObject,} var imports = {anagrams,arrayToHtmlList,average,bottomVisible,byteSize,call,capitalize,capitalizeEveryWord,chainAsync,chunk,clampNumber,cleanObj,cloneRegExp,coalesce,coalesceFactory,collatz,collectInto,compact,compose,copyToClipboard,countOccurrences,countVowels,currentURL,curry,deepFlatten,defer,detectDeviceType,difference,differenceWith,digitize,distance,distinctValuesOfArray,dropElements,dropRight,elementIsVisibleInViewport,elo,escapeHTML,escapeRegExp,everyNth,extendHex,factorial,fibonacci,fibonacciCountUntilNum,fibonacciUntilNum,filterNonUnique,flatten,flattenDepth,flip,fromCamelCase,functionName,gcd,getDaysDiffBetweenDates,getScrollPosition,getStyle,getType,getURLParameters,groupBy,hammingDistance,hasClass,hasFlags,head,hexToRGB,hide,httpsRedirect,initial,initialize2DArray,initializeArrayWithRange,initializeArrayWithValues,inRange,intersection,invertKeyValues,isAbsoluteURL,isArmstrongNumber,isArray,isArrayLike,isBoolean,isDivisible,isEven,isFunction,isNull,isNumber,isPrime,isPrimitive,isPromiseLike,isSorted,isString,isSymbol,isTravisCI,isValidJSON,join,JSONToDate,JSONToFile,last,lcm,lowercaseKeys,mapObject,mask,max,median,memoize,min,negate,nthElement,objectFromPairs,objectToPairs,once,onUserInputChange,orderBy,palindrome,percentile,pick,pipeFunctions,powerset,prettyBytes,primes,promisify,pull,pullAtIndex,pullAtValue,quickSort,randomHexColorCode,randomIntegerInRange,randomNumberInRange,readFileLines,redirect,reducedFilter,remove,repeatString,reverseString,RGBToHex,round,runAsync,runPromisesInSeries,sample,sampleSize,scrollToTop,sdbm,select,setStyle,shallowClone,show,shuffle,similarity,size,sleep,solveRPN,sortCharactersInString,sortedIndex,speechSynthesis,splitLines,spreadOver,standardDeviation,sum,sumPower,symmetricDifference,tail,take,takeRight,timeTaken,toCamelCase,toDecimalMark,toEnglishDate,toggleClass,toKebabCase,tomorrow,toOrdinalSuffix,toSnakeCase,truncateString,truthCheckCollection,unescapeHTML,union,untildify,UUIDGeneratorBrowser,UUIDGeneratorNode,validateNumber,without,words,yesNo,zip,zipObject,}
return imports; return imports;

4
dist/_30s.min.js vendored

File diff suppressed because one or more lines are too long