From 8d0f627991ed4abbfd36a2c07fdf96ac48e30004 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 8 Oct 2018 20:17:54 +0300 Subject: [PATCH 1/4] Delete NOTICE.md --- dist/NOTICE.md | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 dist/NOTICE.md diff --git a/dist/NOTICE.md b/dist/NOTICE.md deleted file mode 100644 index f30f7b1d7..000000000 --- a/dist/NOTICE.md +++ /dev/null @@ -1,15 +0,0 @@ -# WARNING! - -The `_30s` module is not production ready. Do NOT use it in production websites. -It is strictly for testing purposes at this moment in time. Snippets do not have -any unit tests written and will not be reliable. - -Snippet names can and will change without notice between minor versions. - -Given the version `0.x.y`: - -* `x` indicates a snippet name change. -* `y` indicates a new snippet or fix. - -If your project is not serious and you do not care about the above issues, you will want -to use the `es5` version and also include `babel-polyfill` for widest browser support. From af0d56d91b25e044e41e4b0b6367b645ff19b780 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Mon, 8 Oct 2018 17:23:40 +0000 Subject: [PATCH 2/4] Travis build: 613 [custom] --- dist/_30s.es5.js | 66 ++- dist/_30s.es5.min.js | 2 +- dist/_30s.esm.js | 47 +- dist/_30s.js | 50 +- snippet_data/snippets.json | 20 + snippet_data/snippetsArchive.json | 29 +- snippets_archive/README.md | 102 ++-- test/getImages/getImages.js | 4 +- test/heronArea/heronArea.js | 5 + test/heronArea/heronArea.test.js | 6 + test/testlog | 882 +++++++++++++++--------------- 11 files changed, 686 insertions(+), 527 deletions(-) create mode 100644 test/heronArea/heronArea.js create mode 100644 test/heronArea/heronArea.test.js diff --git a/dist/_30s.es5.js b/dist/_30s.es5.js index 9e581e5c9..de2f6ad74 100644 --- a/dist/_30s.es5.js +++ b/dist/_30s.es5.js @@ -223,7 +223,7 @@ }; var atob = function atob(str) { - return new Buffer(str, 'base64').toString('binary'); + return Buffer.from(str, 'base64').toString('binary'); }; var attempt = function attempt(fn) { @@ -328,7 +328,7 @@ }; var btoa = function btoa(str) { - return new Buffer(str, 'binary').toString('base64'); + return Buffer.from(str, 'binary').toString('base64'); }; var byteSize = function byteSize(str) { @@ -1007,6 +1007,16 @@ return (dateFinal - dateInitial) / (1000 * 3600 * 24); }; + var getImages = function getImages(el) { + var includeDuplicates = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var images = _toConsumableArray(el.getElementsByTagName('img')).map(function (img) { + return img.getAttribute('src'); + }); + + return includeDuplicates ? images : _toConsumableArray(new Set(images)); + }; + var getMeridiemSuffixOfInteger = function getMeridiemSuffixOfInteger(num) { return num === 0 || num === 24 ? 12 + 'am' : num === 12 ? 12 + 'pm' : num < 12 ? num % 12 + 'am' : num % 12 + 'pm'; }; @@ -1309,6 +1319,10 @@ return dividend % divisor === 0; }; + var isDuplexStream = function isDuplexStream(val) { + return val !== null && _typeof(val) === 'object' && typeof val.pipe === 'function' && typeof val._read === 'function' && _typeof(val._readableState) === 'object' && typeof val._write === 'function' && _typeof(val._writableState) === 'object'; + }; + var isEmpty = function isEmpty(val) { return val == null || !(Object.keys(val) || val).length; }; @@ -1367,6 +1381,10 @@ return obj !== null && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; }; + var isReadableStream = function isReadableStream(val) { + return val !== null && _typeof(val) === 'object' && typeof val.pipe === 'function' && typeof val._read === 'function' && _typeof(val._readableState) === 'object'; + }; + var isSameDate = function isSameDate(dateA, dateB) { return dateA.toISOString() === dateB.toISOString(); }; @@ -1402,6 +1420,10 @@ } }; + var isStream = function isStream(val) { + return val !== null && _typeof(val) === 'object' && typeof val.pipe === 'function'; + }; + var isString = function isString(val) { return typeof val === 'string'; }; @@ -1431,6 +1453,10 @@ } }; + var isWritableStream = function isWritableStream(val) { + return val !== null && _typeof(val) === 'object' && typeof val.pipe === 'function' && typeof val._write === 'function' && _typeof(val._writableState) === 'object'; + }; + var join = function join(arr) { var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ','; var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : separator; @@ -2493,31 +2519,9 @@ }; var takeRightWhile = function takeRightWhile(arr, func) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = arr.reverse().keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var i = _step.value; - if (func(arr[i])) return arr.reverse().slice(arr.length - i, arr.length); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return arr; + return arr.reduceRight(function (acc, el) { + return func(el) ? acc : [el].concat(_toConsumableArray(acc)); + }, []); }; var takeWhile = function takeWhile(arr, func) { @@ -2655,8 +2659,7 @@ }, acc); }; - var triggerEvent = function triggerEvent(el, eventType) { - var detail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + var triggerEvent = function triggerEvent(el, eventType, detail) { return el.dispatchEvent(new CustomEvent(eventType, { detail: detail })); @@ -3005,6 +3008,7 @@ exports.get = get; exports.getColonTimeFromDate = getColonTimeFromDate; exports.getDaysDiffBetweenDates = getDaysDiffBetweenDates; + exports.getImages = getImages; exports.getMeridiemSuffixOfInteger = getMeridiemSuffixOfInteger; exports.getScrollPosition = getScrollPosition; exports.getStyle = getStyle; @@ -3048,6 +3052,7 @@ exports.isBrowser = isBrowser; exports.isBrowserTabFocused = isBrowserTabFocused; exports.isDivisible = isDivisible; + exports.isDuplexStream = isDuplexStream; exports.isEmpty = isEmpty; exports.isEven = isEven; exports.isFunction = isFunction; @@ -3061,14 +3066,17 @@ exports.isPrime = isPrime; exports.isPrimitive = isPrimitive; exports.isPromiseLike = isPromiseLike; + exports.isReadableStream = isReadableStream; exports.isSameDate = isSameDate; exports.isSorted = isSorted; + exports.isStream = isStream; exports.isString = isString; exports.isSymbol = isSymbol; exports.isTravisCI = isTravisCI; exports.isUndefined = isUndefined; exports.isUpperCase = isUpperCase; exports.isValidJSON = isValidJSON; + exports.isWritableStream = isWritableStream; exports.join = join; exports.last = last; exports.lcm = lcm; diff --git a/dist/_30s.es5.min.js b/dist/_30s.es5.min.js index 481c9c7d7..8183db353 100644 --- a/dist/_30s.es5.min.js +++ b/dist/_30s.es5.min.js @@ -1 +1 @@ -(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?t(exports):'function'==typeof define&&define.amd?define(['exports'],t):t(e._30s={})})(this,function(e){'use strict';function t(e){return t='function'==typeof Symbol&&'symbol'==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&'function'==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?'symbol':typeof e},t(e)}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){for(var t=1;t>e/4).toString(16)})},e.UUIDGeneratorNode=function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^x.randomBytes(1)[0]&15>>e/4).toString(16)})},e.all=function(e){var t=1'.concat(e,'')}).join('')}()},e.ary=function(e,t){return function(){for(var n=arguments.length,i=Array(n),r=0;rt||t>e)return 0;if(0===t||t===e)return 1;if(1===t||t===e-1)return e;e-t=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},e.btoa=function(e){return new Buffer(e,'binary').toString('base64')},e.byteSize=function(e){return new Blob([e]).size},e.call=function(e){for(var t=arguments.length,n=Array(1(n-t)*i?-i:i,o=setInterval(function(){l+=a,document.querySelector(e).innerHTML=l,l>=n&&(document.querySelector(e).innerHTML=n),l>=n&&clearInterval(o)},j(k(r/(n-t))));return o},e.createElement=function(e){var t=document.createElement('div');return t.innerHTML=e,t.firstElementChild},e.createEventHub=function(){return{hub:Object.create(null),emit:function(e,t){(this.hub[e]||[]).forEach(function(e){return e(t)})},on:function(e,t){this.hub[e]||(this.hub[e]=[]),this.hub[e].push(t)},off:function(e,t){var n=(this.hub[e]||[]).findIndex(function(e){return e===t});-1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},e.escapeRegExp=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},e.everyNth=function(e,t){return e.filter(function(n,e){return e%t==t-1})},e.extendHex=function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},e.factorial=function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},e.fibonacci=function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:k(e/864e5),hour:k(e/36e5)%24,minute:k(e/6e4)%60,second:k(e/1e3)%60,millisecond:k(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){var t=r(e,2),n=t[0],i=t[1];return''.concat(i,' ').concat(n).concat(1===i?'':'s')}).join(', ')},e.fromCamelCase=function(e){var t=1e?e%12+'am':e%12+'pm'},e.getScrollPosition=function(){var e=0>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '.concat(255&n):'')+')'},e.hide=function(e){return e.forEach(function(t){return t.style.display='none'})},e.httpGet=function(e,t){var n=2n){var i=[t,n];n=i[0],t=i[1]}return null==n?0<=e&&e=t&&et},e.isAnagram=function(e,t){var n=function(e){return e.toLowerCase().replace(/[^a-z0-9]/gi,'').split('').sort().join('')};return n(e)===n(t)},e.isArrayLike=function(e){return null!=e&&'function'==typeof e[Symbol.iterator]},e.isBeforeDate=function(e,t){return ee.length?t:e})},e.lowercaseKeys=function(e){return Object.keys(e).reduce(function(t,n){return t[n.toLowerCase()]=e[n],t},{})},e.luhnCheck=function(e){var t=(e+'').split('').reverse().map(function(e){return parseInt(e)}),n=t.splice(0,1)[0],i=t.reduce(function(e,t,n){return 0==n%2?e+2*t%9||9:e+t},0);return i+=n,0==i%10},e.mapKeys=function(e,t){return Object.keys(e).reduce(function(n,i){return n[t(e[i],i,e)]=e[i],n},{})},e.mapObject=function(e,t){return function(n){return n=[e,e.map(t)],n[0].reduce(function(e,t,i){return e[t]=n[1][i],e},{})}()},e.mapString=function(e,t){return e.split('').map(function(n,r){return t(n,r,e)}).join('')},e.mapValues=function(e,t){return Object.keys(e).reduce(function(n,i){return n[i]=t(e[i],i,e),n},{})},e.mask=function(e){var t=1r-n&&(t='mouse',e(t),document.removeEventListener('mousemove',i)),n=r};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',i))})},e.once=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,i=Array(n),r=0;rd?1:sj(e))return e+(i?' ':'')+r[0];var l=m(k(Math.log10(0>e?-e:e)/3),r.length-1),a=+((0>e?-e:e)/u(1e3,l)).toPrecision(t);return(0>e?'-':'')+a+(i?' ':'')+r[l]},e.primes=function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=k(g(e)),i=Array.from({length:n-1}).map(function(e,t){return t+2});return i.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t===e})}),t},e.promisify=function(e){return function(){for(var t=arguments.length,n=Array(t),i=0;ie[e.length-1],i=e.findIndex(function(e){return n?t>=e:t<=e});return-1===i?e.length:i},e.sortedIndexBy=function(e,t,n){var i=n(e[0])>n(e[e.length-1]),r=n(t),l=e.findIndex(function(e){return i?r>=n(e):r<=n(e)});return-1===l?e.length:l},e.sortedLastIndex=function(e,t){var n=e[0]>e[e.length-1],i=e.reverse().findIndex(function(e){return n?t<=e:t>=e});return-1===i?0:e.length-i},e.sortedLastIndexBy=function(e,t,n){var i=n(e[0])>n(e[e.length-1]),r=n(t),l=e.map(n).reverse().findIndex(function(e){return i?r<=e:r>=e});return-1===l?0:e.length-l},e.splitLines=function(e){return e.split(/\r?\n/)},e.spreadOver=function(e){return function(t){return e.apply(void 0,o(t))}},e.stableSort=function(e,t){return e.map(function(e,t){return{item:e,index:t}}).sort(function(e,n){return t(e.item,n.item)||e.index-n.index}).map(function(e){var t=e.item;return t})},e.standardDeviation=function(e){var t=!!(1=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,l){return n.concat(e(t.slice(0,l)+t.slice(l+1)).map(function(e){return r+e}))},[])},e.stripHTMLTags=function(e){return e.replace(/<[^>]*>/g,'')},e.sum=function(){for(var e=arguments.length,t=Array(e),n=0;n=t&&(e.apply(l,a),r=Date.now())},t-(Date.now()-r))):(e.apply(l,a),r=Date.now(),n=!0)}},e.timeTaken=function(e){console.time('timeTaken');var t=e();return console.timeEnd('timeTaken'),t},e.times=function(e,t){for(var n=2t?e.slice(0,3r.length)throw new RangeError('Arguments too few!');return n(e)(r.slice(0,t))}},e.unescapeHTML=function(e){return e.replace(/&|<|>|'|"/g,function(e){return{"&":'&',"<":'<',">":'>',"'":'\'',""":'"'}[e]||e})},e.unflattenObject=function(e){return Object.keys(e).reduce(function(t,n){if(-1!==n.indexOf('.')){var r=n.split('.');Object.assign(t,JSON.parse('{'+r.map(function(e,t){return t===r.length-1?'"'.concat(e,'":'):'"'.concat(e,'":{')}).join('')+e[n]+'}'.repeat(r.length)))}else t[n]=e[n];return t},{})},e.unfold=function(e,t){for(var n=[],i=[null,t];i=e(i[1]);)n.push(i[0]);return n},e.union=function(e,t){return Array.from(new Set(o(e).concat(o(t))))},e.unionBy=function(e,t,n){var i=new Set(e.map(function(e){return n(e)}));return Array.from(new Set(o(e).concat(o(t.filter(function(e){return!i.has(n(e))})))))},e.unionWith=function(e,t,n){return Array.from(new Set(o(e).concat(o(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},e.uniqueElements=function(e){return o(new Set(e))},e.uniqueElementsBy=function(e,t){return e.reduce(function(e,n){return e.some(function(e){return t(n,e)})||e.push(n),e},[])},e.uniqueElementsByRight=function(e,t){return e.reduceRight(function(e,n){return e.some(function(e){return t(n,e)})||e.push(n),e},[])},e.uniqueSymmetricDifference=function(e,t){return o(new Set(o(e.filter(function(e){return!t.includes(e)})).concat(o(t.filter(function(t){return!e.includes(t)})))))},e.untildify=function(e){return e.replace(/^~($|\/|\\)/,''.concat('undefined'!=typeof require&&require('os').homedir(),'$1'))},e.unzip=function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:_.apply(Math,o(e.map(function(e){return e.length})))}).map(function(){return[]}))},e.unzipWith=function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:_.apply(Math,o(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,o(e))})},e.validateNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},e.when=function(e,t){return function(n){return e(n)?t(n):n}},e.without=function(e){for(var t=arguments.length,n=Array(1>e/4).toString(16)})},e.UUIDGeneratorNode=function(){return'10000000-1000-4000-8000-100000000000'.replace(/[018]/g,function(e){return(e^x.randomBytes(1)[0]&15>>e/4).toString(16)})},e.all=function(e){var t=1'.concat(e,'')}).join('')}()},e.ary=function(e,t){return function(){for(var n=arguments.length,i=Array(n),r=0;rt||t>e)return 0;if(0===t||t===e)return 1;if(1===t||t===e-1)return e;e-t=(document.documentElement.scrollHeight||document.documentElement.clientHeight)},e.btoa=function(e){return Buffer.from(e,'binary').toString('base64')},e.byteSize=function(e){return new Blob([e]).size},e.call=function(e){for(var t=arguments.length,n=Array(1(n-t)*i?-i:i,o=setInterval(function(){a+=l,document.querySelector(e).innerHTML=a,a>=n&&(document.querySelector(e).innerHTML=n),a>=n&&clearInterval(o)},j(k(r/(n-t))));return o},e.createElement=function(e){var t=document.createElement('div');return t.innerHTML=e,t.firstElementChild},e.createEventHub=function(){return{hub:Object.create(null),emit:function(e,t){(this.hub[e]||[]).forEach(function(e){return e(t)})},on:function(e,t){this.hub[e]||(this.hub[e]=[]),this.hub[e].push(t)},off:function(e,t){var n=(this.hub[e]||[]).findIndex(function(e){return e===t});-1'"]/g,function(e){return{"&":'&',"<":'<',">":'>',"'":''','"':'"'}[e]||e})},e.escapeRegExp=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,'\\$&')},e.everyNth=function(e,t){return e.filter(function(n,e){return e%t==t-1})},e.extendHex=function(e){return'#'+e.slice(e.startsWith('#')?1:0).split('').map(function(e){return e+e}).join('')},e.factorial=function e(t){return 0>t?function(){throw new TypeError('Negative numbers are not allowed!')}():1>=t?1:t*e(t-1)},e.fibonacci=function(e){return Array.from({length:e}).reduce(function(e,t,n){return e.concat(1e&&(e=-e);var t={day:k(e/864e5),hour:k(e/36e5)%24,minute:k(e/6e4)%60,second:k(e/1e3)%60,millisecond:k(e)%1e3};return Object.entries(t).filter(function(e){return 0!==e[1]}).map(function(e){var t=r(e,2),n=t[0],i=t[1];return''.concat(i,' ').concat(n).concat(1===i?'':'s')}).join(', ')},e.fromCamelCase=function(e){var t=1e?e%12+'am':e%12+'pm'},e.getScrollPosition=function(){var e=0>>(t?24:16))+', '+((n&(t?16711680:65280))>>>(t?16:8))+', '+((n&(t?65280:255))>>>(t?8:0))+(t?', '.concat(255&n):'')+')'},e.hide=function(e){return e.forEach(function(t){return t.style.display='none'})},e.httpGet=function(e,t){var n=2n){var i=[t,n];n=i[0],t=i[1]}return null==n?0<=e&&e=t&&et},e.isAnagram=function(e,t){var n=function(e){return e.toLowerCase().replace(/[^a-z0-9]/gi,'').split('').sort().join('')};return n(e)===n(t)},e.isArrayLike=function(e){return null!=e&&'function'==typeof e[Symbol.iterator]},e.isBeforeDate=function(e,t){return ee.length?t:e})},e.lowercaseKeys=function(e){return Object.keys(e).reduce(function(t,n){return t[n.toLowerCase()]=e[n],t},{})},e.luhnCheck=function(e){var t=(e+'').split('').reverse().map(function(e){return parseInt(e)}),n=t.splice(0,1)[0],i=t.reduce(function(e,t,n){return 0==n%2?e+2*t%9||9:e+t},0);return i+=n,0==i%10},e.mapKeys=function(e,t){return Object.keys(e).reduce(function(n,i){return n[t(e[i],i,e)]=e[i],n},{})},e.mapObject=function(e,t){return function(n){return n=[e,e.map(t)],n[0].reduce(function(e,t,i){return e[t]=n[1][i],e},{})}()},e.mapString=function(e,t){return e.split('').map(function(n,r){return t(n,r,e)}).join('')},e.mapValues=function(e,t){return Object.keys(e).reduce(function(n,i){return n[i]=t(e[i],i,e),n},{})},e.mask=function(e){var t=1r-n&&(t='mouse',e(t),document.removeEventListener('mousemove',i)),n=r};document.addEventListener('touchstart',function(){'touch'==t||(t='touch',e(t),document.addEventListener('mousemove',i))})},e.once=function(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,i=Array(n),r=0;rd?1:sj(e))return e+(i?' ':'')+r[0];var a=m(k(Math.log10(0>e?-e:e)/3),r.length-1),l=+((0>e?-e:e)/u(1e3,a)).toPrecision(t);return(0>e?'-':'')+l+(i?' ':'')+r[a]},e.primes=function(e){var t=Array.from({length:e-1}).map(function(e,t){return t+2}),n=k(g(e)),i=Array.from({length:n-1}).map(function(e,t){return t+2});return i.forEach(function(e){return t=t.filter(function(t){return 0!=t%e||t===e})}),t},e.promisify=function(e){return function(){for(var t=arguments.length,n=Array(t),i=0;ie[e.length-1],i=e.findIndex(function(e){return n?t>=e:t<=e});return-1===i?e.length:i},e.sortedIndexBy=function(e,t,n){var i=n(e[0])>n(e[e.length-1]),r=n(t),a=e.findIndex(function(e){return i?r>=n(e):r<=n(e)});return-1===a?e.length:a},e.sortedLastIndex=function(e,t){var n=e[0]>e[e.length-1],i=e.reverse().findIndex(function(e){return n?t<=e:t>=e});return-1===i?0:e.length-i},e.sortedLastIndexBy=function(e,t,n){var i=n(e[0])>n(e[e.length-1]),r=n(t),a=e.map(n).reverse().findIndex(function(e){return i?r<=e:r>=e});return-1===a?0:e.length-a},e.splitLines=function(e){return e.split(/\r?\n/)},e.spreadOver=function(e){return function(t){return e.apply(void 0,o(t))}},e.stableSort=function(e,t){return e.map(function(e,t){return{item:e,index:t}}).sort(function(e,n){return t(e.item,n.item)||e.index-n.index}).map(function(e){var t=e.item;return t})},e.standardDeviation=function(e){var t=!!(1=t.length?2===t.length?[t,t[1]+t[0]]:[t]:t.split('').reduce(function(n,r,a){return n.concat(e(t.slice(0,a)+t.slice(a+1)).map(function(e){return r+e}))},[])},e.stripHTMLTags=function(e){return e.replace(/<[^>]*>/g,'')},e.sum=function(){for(var e=arguments.length,t=Array(e),n=0;n=t&&(e.apply(a,l),r=Date.now())},t-(Date.now()-r))):(e.apply(a,l),r=Date.now(),n=!0)}},e.timeTaken=function(e){console.time('timeTaken');var t=e();return console.timeEnd('timeTaken'),t},e.times=function(e,t){for(var n=2t?e.slice(0,3r.length)throw new RangeError('Arguments too few!');return n(e)(r.slice(0,t))}},e.unescapeHTML=function(e){return e.replace(/&|<|>|'|"/g,function(e){return{"&":'&',"<":'<',">":'>',"'":'\'',""":'"'}[e]||e})},e.unflattenObject=function(e){return Object.keys(e).reduce(function(t,n){if(-1!==n.indexOf('.')){var r=n.split('.');Object.assign(t,JSON.parse('{'+r.map(function(e,t){return t===r.length-1?'"'.concat(e,'":'):'"'.concat(e,'":{')}).join('')+e[n]+'}'.repeat(r.length)))}else t[n]=e[n];return t},{})},e.unfold=function(e,t){for(var n=[],i=[null,t];i=e(i[1]);)n.push(i[0]);return n},e.union=function(e,t){return Array.from(new Set(o(e).concat(o(t))))},e.unionBy=function(e,t,n){var i=new Set(e.map(function(e){return n(e)}));return Array.from(new Set(o(e).concat(o(t.filter(function(e){return!i.has(n(e))})))))},e.unionWith=function(e,t,n){return Array.from(new Set(o(e).concat(o(t.filter(function(t){return-1===e.findIndex(function(e){return n(t,e)})})))))},e.uniqueElements=function(e){return o(new Set(e))},e.uniqueElementsBy=function(e,t){return e.reduce(function(e,n){return e.some(function(e){return t(n,e)})||e.push(n),e},[])},e.uniqueElementsByRight=function(e,t){return e.reduceRight(function(e,n){return e.some(function(e){return t(n,e)})||e.push(n),e},[])},e.uniqueSymmetricDifference=function(e,t){return o(new Set(o(e.filter(function(e){return!t.includes(e)})).concat(o(t.filter(function(t){return!e.includes(t)})))))},e.untildify=function(e){return e.replace(/^~($|\/|\\)/,''.concat('undefined'!=typeof require&&require('os').homedir(),'$1'))},e.unzip=function(e){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:_.apply(Math,o(e.map(function(e){return e.length})))}).map(function(){return[]}))},e.unzipWith=function(e,t){return e.reduce(function(e,t){return t.forEach(function(t,n){return e[n].push(t)}),e},Array.from({length:_.apply(Math,o(e.map(function(e){return e.length})))}).map(function(){return[]})).map(function(e){return t.apply(void 0,o(e))})},e.validateNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)&&+e==e},e.when=function(e,t){return function(n){return e(n)?t(n):n}},e.without=function(e){for(var t=arguments.length,n=Array(1 const ary = (fn, n) => (...args) => fn(...args.slice(0, n)); -const atob = str => new Buffer(str, 'base64').toString('binary'); +const atob = str => Buffer.from(str, 'base64').toString('binary'); const attempt = (fn, ...args) => { try { @@ -124,7 +124,7 @@ const bottomVisible = () => document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight); -const btoa = str => new Buffer(str, 'binary').toString('base64'); +const btoa = str => Buffer.from(str, 'binary').toString('base64'); const byteSize = str => new Blob([str]).size; @@ -509,6 +509,11 @@ const getColonTimeFromDate = date => date.toTimeString().slice(0, 8); const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24); +const getImages = (el, includeDuplicates = false) => { + const images = [...el.getElementsByTagName('img')].map(img => img.getAttribute('src')); + return includeDuplicates ? images : [...new Set(images)]; +}; + const getMeridiemSuffixOfInteger = num => num === 0 || num === 24 ? 12 + 'am' @@ -704,6 +709,15 @@ const isBrowserTabFocused = () => !document.hidden; const isDivisible = (dividend, divisor) => dividend % divisor === 0; +const isDuplexStream = val => + val !== null && + typeof val === 'object' && + typeof val.pipe === 'function' && + typeof val._read === 'function' && + typeof val._readableState === 'object' && + typeof val._write === 'function' && + typeof val._writableState === 'object'; + const isEmpty = val => val == null || !(Object.keys(val) || val).length; const isEven = num => num % 2 === 0; @@ -737,6 +751,13 @@ const isPromiseLike = obj => (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; +const isReadableStream = val => + val !== null && + typeof val === 'object' && + typeof val.pipe === 'function' && + typeof val._read === 'function' && + typeof val._readableState === 'object'; + const isSameDate = (dateA, dateB) => dateA.toISOString() === dateB.toISOString(); const isSorted = arr => { @@ -748,6 +769,8 @@ const isSorted = arr => { } }; +const isStream = val => val !== null && typeof val === 'object' && typeof val.pipe === 'function'; + const isString = val => typeof val === 'string'; const isSymbol = val => typeof val === 'symbol'; @@ -767,6 +790,13 @@ const isValidJSON = obj => { } }; +const isWritableStream = val => + val !== null && + typeof val === 'object' && + typeof val.pipe === 'function' && + typeof val._write === 'function' && + typeof val._writableState === 'object'; + const join = (arr, separator = ',', end = separator) => arr.reduce( (acc, val, i) => @@ -1385,11 +1415,8 @@ const take = (arr, n = 1) => arr.slice(0, n); const takeRight = (arr, n = 1) => arr.slice(arr.length - n, arr.length); -const takeRightWhile = (arr, func) => { - for (let i of arr.reverse().keys()) - if (func(arr[i])) return arr.reverse().slice(arr.length - i, arr.length); - return arr; -}; +const takeRightWhile = (arr, func) => + arr.reduceRight((acc, el) => (func(el) ? acc : [el, ...acc]), []); const takeWhile = (arr, func) => { for (const [i, val] of arr.entries()) if (func(val)) return arr.slice(0, i); @@ -1492,8 +1519,8 @@ const tomorrow = (long = false) => { const transform = (obj, fn, acc) => Object.keys(obj).reduce((a, k) => fn(a, obj[k], k, obj), acc); -const triggerEvent = (el, eventType, detail = undefined) => - el.dispatchEvent(new CustomEvent(eventType, { detail: detail })); +const triggerEvent = (el, eventType, detail) => + el.dispatchEvent(new CustomEvent(eventType, { detail })); const truncateString = (str, num) => str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str; @@ -1624,4 +1651,4 @@ const zipWith = (...array) => { ); }; -export { 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, 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, isEmpty, isEven, isFunction, isLowerCase, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrime, isPrimitive, isPromiseLike, isSameDate, isSorted, isString, isSymbol, isTravisCI, isUndefined, isUpperCase, isValidJSON, 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, 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 }; +export { 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, 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 }; diff --git a/dist/_30s.js b/dist/_30s.js index b93ea6662..bfd04c12b 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -78,7 +78,7 @@ const ary = (fn, n) => (...args) => fn(...args.slice(0, n)); - const atob = str => new Buffer(str, 'base64').toString('binary'); + const atob = str => Buffer.from(str, 'base64').toString('binary'); const attempt = (fn, ...args) => { try { @@ -130,7 +130,7 @@ document.documentElement.clientHeight + window.scrollY >= (document.documentElement.scrollHeight || document.documentElement.clientHeight); - const btoa = str => new Buffer(str, 'binary').toString('base64'); + const btoa = str => Buffer.from(str, 'binary').toString('base64'); const byteSize = str => new Blob([str]).size; @@ -515,6 +515,11 @@ const getDaysDiffBetweenDates = (dateInitial, dateFinal) => (dateFinal - dateInitial) / (1000 * 3600 * 24); + const getImages = (el, includeDuplicates = false) => { + const images = [...el.getElementsByTagName('img')].map(img => img.getAttribute('src')); + return includeDuplicates ? images : [...new Set(images)]; + }; + const getMeridiemSuffixOfInteger = num => num === 0 || num === 24 ? 12 + 'am' @@ -710,6 +715,15 @@ const isDivisible = (dividend, divisor) => dividend % divisor === 0; + const isDuplexStream = val => + val !== null && + typeof val === 'object' && + typeof val.pipe === 'function' && + typeof val._read === 'function' && + typeof val._readableState === 'object' && + typeof val._write === 'function' && + typeof val._writableState === 'object'; + const isEmpty = val => val == null || !(Object.keys(val) || val).length; const isEven = num => num % 2 === 0; @@ -743,6 +757,13 @@ (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; + const isReadableStream = val => + val !== null && + typeof val === 'object' && + typeof val.pipe === 'function' && + typeof val._read === 'function' && + typeof val._readableState === 'object'; + const isSameDate = (dateA, dateB) => dateA.toISOString() === dateB.toISOString(); const isSorted = arr => { @@ -754,6 +775,8 @@ } }; + const isStream = val => val !== null && typeof val === 'object' && typeof val.pipe === 'function'; + const isString = val => typeof val === 'string'; const isSymbol = val => typeof val === 'symbol'; @@ -773,6 +796,13 @@ } }; + const isWritableStream = val => + val !== null && + typeof val === 'object' && + typeof val.pipe === 'function' && + typeof val._write === 'function' && + typeof val._writableState === 'object'; + const join = (arr, separator = ',', end = separator) => arr.reduce( (acc, val, i) => @@ -1391,11 +1421,8 @@ const takeRight = (arr, n = 1) => arr.slice(arr.length - n, arr.length); - const takeRightWhile = (arr, func) => { - for (let i of arr.reverse().keys()) - if (func(arr[i])) return arr.reverse().slice(arr.length - i, arr.length); - return arr; - }; + const takeRightWhile = (arr, func) => + arr.reduceRight((acc, el) => (func(el) ? acc : [el, ...acc]), []); const takeWhile = (arr, func) => { for (const [i, val] of arr.entries()) if (func(val)) return arr.slice(0, i); @@ -1498,8 +1525,8 @@ const transform = (obj, fn, acc) => Object.keys(obj).reduce((a, k) => fn(a, obj[k], k, obj), acc); - const triggerEvent = (el, eventType, detail = undefined) => - el.dispatchEvent(new CustomEvent(eventType, { detail: detail })); + const triggerEvent = (el, eventType, detail) => + el.dispatchEvent(new CustomEvent(eventType, { detail })); const truncateString = (str, num) => str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str; @@ -1734,6 +1761,7 @@ exports.get = get; exports.getColonTimeFromDate = getColonTimeFromDate; exports.getDaysDiffBetweenDates = getDaysDiffBetweenDates; + exports.getImages = getImages; exports.getMeridiemSuffixOfInteger = getMeridiemSuffixOfInteger; exports.getScrollPosition = getScrollPosition; exports.getStyle = getStyle; @@ -1777,6 +1805,7 @@ exports.isBrowser = isBrowser; exports.isBrowserTabFocused = isBrowserTabFocused; exports.isDivisible = isDivisible; + exports.isDuplexStream = isDuplexStream; exports.isEmpty = isEmpty; exports.isEven = isEven; exports.isFunction = isFunction; @@ -1790,14 +1819,17 @@ exports.isPrime = isPrime; exports.isPrimitive = isPrimitive; exports.isPromiseLike = isPromiseLike; + exports.isReadableStream = isReadableStream; exports.isSameDate = isSameDate; exports.isSorted = isSorted; + exports.isStream = isStream; exports.isString = isString; exports.isSymbol = isSymbol; exports.isTravisCI = isTravisCI; exports.isUndefined = isUndefined; exports.isUpperCase = isUpperCase; exports.isValidJSON = isValidJSON; + exports.isWritableStream = isWritableStream; exports.join = join; exports.last = last; exports.lcm = lcm; diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index 60de8f10e..6f24447e1 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -2031,6 +2031,26 @@ "hash": "baeec5f4220f1e457b11034e29d84277dbdc9fc5c9e69c1a225bb22f13b843ec" } }, + { + "id": "getImages", + "type": "snippet", + "attributes": { + "fileName": "getImages.md", + "text": "Fetches all images from within an element and puts them into an array\n\nUse `Element.prototype.getElementsByTagName()` to fetch all `` elements inside the provided element, `Array.prototype.map()` to map every `src` attribute of their respective `` element, then create a `Set` to eliminate duplicates and return the array.", + "codeBlocks": [ + "const getImages = (el, includeDuplicates = false) => {\n const images = [...el.getElementsByTagName('img')].map(img => img.getAttribute('src'));\n return includeDuplicates ? images : [...new Set(images)];\n};", + "getImages(document, true); // ['image1.jpg', 'image2.png', 'image1.png', '...']\ngetImages(document, false); // ['image1.jpg', 'image2.png', '...']" + ], + "tags": [ + "browser", + "beginner" + ] + }, + "meta": { + "archived": false, + "hash": "0f2ba02c6de1e9396abbef584139bea4dc379a6d465f4bebb151ad3b0f77ff6f" + } + }, { "id": "getMeridiemSuffixOfInteger", "type": "snippet", diff --git a/snippet_data/snippetsArchive.json b/snippet_data/snippetsArchive.json index a9c45958b..80911274e 100644 --- a/snippet_data/snippetsArchive.json +++ b/snippet_data/snippetsArchive.json @@ -119,6 +119,23 @@ "hash": "9de50bed5b8c247176570f743c8154a5ec4093432f8a09ba91c423d78af47169" } }, + { + "id": "heronArea", + "type": "snippet", + "attributes": { + "fileName": "heronArea.md", + "text": "Returns the area of a triangle using only the 3 side lengths, Heron's formula. Assumes that the sides define a valid triangle. Does NOT assume it is a right triangle.\n\nMore information on what Heron's formula is and why it works available here: https://en.wikipedia.org/wiki/Heron%27s_formula.\n\nUses `Math.sqrt()` to find the square root of a value.", + "codeBlocks": [ + "const heronArea = (side_a, side_b, side_c) => {\n const p = (side_a + side_b + side_c) / 2\n return Math.sqrt(p * (p-side_a) * (p-side_b) * (p-side_c))\n };", + "heronArea(3, 4, 5); // 6" + ], + "tags": [] + }, + "meta": { + "archived": true, + "hash": "594721a84a8fe31c32482e9f475f5126b7cf499462d9408b3cfaee2021a96a30" + } + }, { "id": "howManyTimes", "type": "snippet", @@ -297,8 +314,10 @@ "fibonacciCountUntilNum(10); // 7", "const fibonacciUntilNum = num => {\n let n = Math.ceil(Math.log(num * Math.sqrt(5) + 1 / 2) / Math.log((Math.sqrt(5) + 1) / 2));\n return Array.from({ length: n }).reduce(\n (acc, val, i) => acc.concat(i > 1 ? acc[i - 1] + acc[i - 2] : i),\n []\n );\n};", "fibonacciUntilNum(10); // [ 0, 1, 1, 2, 3, 5, 8 ]", - "const howManyTimes = (num, divisor) => {\n if (divisor === 1 || divisor === -1) return Infinity;\n if (divisor === 0) return 0;\n let i = 0;\n while (Number.isInteger(num / divisor)) {\n i++;\n num = num / divisor;\n }\n return i;\n};", - "howManyTimes(100, 2); // 2\nhowManyTimes(100, 2.5); // 2\nhowManyTimes(100, 0); // 0\nhowManyTimes(100, -1); // Infinity", + "const heronArea = (side_a, side_b, side_c) => {\n const p = (side_a + side_b + side_c) / 2\n return Math.sqrt(p * (p-side_a) * (p-side_b) * (p-side_c))\n };", + "heronArea(3, 4, 5); // 6", + "const httpDelete = (url, callback, err = console.error) => {\n const request = new XMLHttpRequest();\n request.open('DELETE', url, true);\n request.onload = () => callback(request);\n request.onerror = () => err(request);\n request.send();\n};", + "httpDelete('https://website.com/users/123', request => {\n console.log(request.responseText);\n}); // 'Deletes a user from the database'", "const httpPut = (url, data, callback, err = console.error) => {\n const request = new XMLHttpRequest();\n request.open(\"PUT\", url, true);\n request.setRequestHeader('Content-type','application/json; charset=utf-8');\n request.onload = () => callback(request);\n request.onerror = () => err(request);\n request.send(data);\n};", "const password = \"fooBaz\";\nconst data = JSON.stringify(password);\nhttpPut('https://website.com/users/123', data, request => {\n console.log(request.responseText);\n}); // 'Updates a user's password in database'", "const isArmstrongNumber = digits =>\n (arr => arr.reduce((a, d) => a + parseInt(d) ** arr.length, 0) == digits)(\n (digits + '').split('')\n );", @@ -315,14 +334,14 @@ "removeVowels(\"foobAr\"); // \"fbr\"\nremoveVowels(\"foobAr\",\"*\"); // \"f**b*r\"", "const solveRPN = rpn => {\n const OPERATORS = {\n '*': (a, b) => a * b,\n '+': (a, b) => a + b,\n '-': (a, b) => a - b,\n '/': (a, b) => a / b,\n '**': (a, b) => a ** b\n };\n const [stack, solve] = [\n [],\n rpn\n .replace(/\\^/g, '**')\n .split(/\\s+/g)\n .filter(el => !/\\s+/.test(el) && el !== '')\n ];\n solve.forEach(symbol => {\n if (!isNaN(parseFloat(symbol)) && isFinite(symbol)) {\n stack.push(symbol);\n } else if (Object.keys(OPERATORS).includes(symbol)) {\n const [a, b] = [stack.pop(), stack.pop()];\n stack.push(OPERATORS[symbol](parseFloat(b), parseFloat(a)));\n } else {\n throw `${symbol} is not a recognized symbol`;\n }\n });\n if (stack.length === 1) return stack.pop();\n else throw `${rpn} is not a proper RPN. Please check it and try again`;\n};", "solveRPN('15 7 1 1 + - / 3 * 2 1 1 + + -'); // 5\nsolveRPN('2 3 ^'); // 8", - "const httpDelete = (url, callback, err = console.error) => {\n const request = new XMLHttpRequest();\n request.open('DELETE', url, true);\n request.onload = () => callback(request);\n request.onerror = () => err(request);\n request.send();\n};", - "httpDelete('https://website.com/users/123', request => {\n console.log(request.responseText);\n}); // 'Deletes a user from the database'" + "const howManyTimes = (num, divisor) => {\n if (divisor === 1 || divisor === -1) return Infinity;\n if (divisor === 0) return 0;\n let i = 0;\n while (Number.isInteger(num / divisor)) {\n i++;\n num = num / divisor;\n }\n return i;\n};", + "howManyTimes(100, 2); // 2\nhowManyTimes(100, 2.5); // 2\nhowManyTimes(100, 0); // 0\nhowManyTimes(100, -1); // Infinity" ], "tags": [] }, "meta": { "archived": true, - "hash": "923a1f48f03450680f6150058f7ae52edf8a08a0d00d57cf26aa803f707643c9" + "hash": "50abe1eb4fadd6d7d8ab5c5dc027f0bf34e6c391b6da1367ddee907abd741a30" } }, { diff --git a/snippets_archive/README.md b/snippets_archive/README.md index b001d2eb8..107f0ec0b 100644 --- a/snippets_archive/README.md +++ b/snippets_archive/README.md @@ -11,7 +11,8 @@ These snippets, while useful and interesting, didn't quite make it into the repo * [`factors`](#factors) * [`fibonacciCountUntilNum`](#fibonaccicountuntilnum) * [`fibonacciUntilNum`](#fibonacciuntilnum) -* [`howManyTimes`](#howmanytimes) +* [`heronArea`](#heronarea) +* [`httpDelete`](#httpdelete) * [`httpPut`](#httpput) * [`isArmstrongNumber`](#isarmstrongnumber) * [`isSimilar`](#issimilar) @@ -20,7 +21,7 @@ These snippets, while useful and interesting, didn't quite make it into the repo * [`quickSort`](#quicksort) * [`removeVowels`](#removevowels) * [`solveRPN`](#solverpn) -* [`httpDelete`](#httpdelete) +* [`howManyTimes`](#howmanytimes) --- ### JSONToDate @@ -283,26 +284,49 @@ fibonacciUntilNum(10); // [ 0, 1, 1, 2, 3, 5, 8 ]
[⬆ Back to top](#table-of-contents) -### howManyTimes +### heronArea -Returns the number of times `num` can be divided by `divisor` (integer or fractional) without getting a fractional answer. -Works for both negative and positive integers. +Returns the area of a triangle using only the 3 side lengths, Heron's formula. Assumes that the sides define a valid triangle. Does NOT assume it is a right triangle. + +More information on what Heron's formula is and why it works available here: https://en.wikipedia.org/wiki/Heron%27s_formula. + +Uses `Math.sqrt()` to find the square root of a value. -If `divisor` is `-1` or `1` return `Infinity`. -If `divisor` is `-0` or `0` return `0`. -Otherwise, keep dividing `num` with `divisor` and incrementing `i`, while the result is an integer. -Return the number of times the loop was executed, `i`. ```js -const howManyTimes = (num, divisor) => { - if (divisor === 1 || divisor === -1) return Infinity; - if (divisor === 0) return 0; - let i = 0; - while (Number.isInteger(num / divisor)) { - i++; - num = num / divisor; - } - return i; +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)) + }; +``` + +
+Examples + +```js +heronArea(3, 4, 5); // 6 +``` + +
+ +
[⬆ Back to top](#table-of-contents) + +### httpDelete + +Makes a `DELETE` request to the passed URL. + +Use `XMLHttpRequest` web api to make a `delete` request to the given `url`. +Handle the `onload` event, by running the provided `callback` function. +Handle the `onerror` event, by running the provided `err` function. +Omit the third argument, `err` to log the request to the console's error stream by default. + +```js +const httpDelete = (url, callback, err = console.error) => { + const request = new XMLHttpRequest(); + request.open('DELETE', url, true); + request.onload = () => callback(request); + request.onerror = () => err(request); + request.send(); }; ``` @@ -310,10 +334,9 @@ const howManyTimes = (num, divisor) => { Examples ```js -howManyTimes(100, 2); // 2 -howManyTimes(100, 2.5); // 2 -howManyTimes(100, 0); // 0 -howManyTimes(100, -1); // Infinity +httpDelete('https://website.com/users/123', request => { + console.log(request.responseText); +}); // 'Deletes a user from the database' ``` @@ -588,22 +611,26 @@ solveRPN('2 3 ^'); // 8
[⬆ Back to top](#table-of-contents) -### httpDelete +### howManyTimes -Makes a `DELETE` request to the passed URL. +Returns the number of times `num` can be divided by `divisor` (integer or fractional) without getting a fractional answer. +Works for both negative and positive integers. -Use `XMLHttpRequest` web api to make a `delete` request to the given `url`. -Handle the `onload` event, by running the provided `callback` function. -Handle the `onerror` event, by running the provided `err` function. -Omit the third argument, `err` to log the request to the console's error stream by default. +If `divisor` is `-1` or `1` return `Infinity`. +If `divisor` is `-0` or `0` return `0`. +Otherwise, keep dividing `num` with `divisor` and incrementing `i`, while the result is an integer. +Return the number of times the loop was executed, `i`. ```js -const httpDelete = (url, callback, err = console.error) => { - const request = new XMLHttpRequest(); - request.open('DELETE', url, true); - request.onload = () => callback(request); - request.onerror = () => err(request); - request.send(); +const howManyTimes = (num, divisor) => { + if (divisor === 1 || divisor === -1) return Infinity; + if (divisor === 0) return 0; + let i = 0; + while (Number.isInteger(num / divisor)) { + i++; + num = num / divisor; + } + return i; }; ``` @@ -611,9 +638,10 @@ const httpDelete = (url, callback, err = console.error) => { Examples ```js -httpDelete('https://website.com/users/123', request => { - console.log(request.responseText); -}); // 'Deletes a user from the database' +howManyTimes(100, 2); // 2 +howManyTimes(100, 2.5); // 2 +howManyTimes(100, 0); // 0 +howManyTimes(100, -1); // Infinity ``` diff --git a/test/getImages/getImages.js b/test/getImages/getImages.js index a01a6c818..675dc839f 100644 --- a/test/getImages/getImages.js +++ b/test/getImages/getImages.js @@ -1,5 +1,5 @@ const getImages = (el, includeDuplicates = false) => { - const images = [...el.getElementsByTagName("img")].map(img => img.getAttribute("src")); - return includeDuplicates ? images : [...(new Set(images))]; + const images = [...el.getElementsByTagName('img')].map(img => img.getAttribute('src')); + return includeDuplicates ? images : [...new Set(images)]; }; module.exports = getImages; diff --git a/test/heronArea/heronArea.js b/test/heronArea/heronArea.js new file mode 100644 index 000000000..3735380f1 --- /dev/null +++ b/test/heronArea/heronArea.js @@ -0,0 +1,5 @@ +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)) + }; +module.exports = heronArea; diff --git a/test/heronArea/heronArea.test.js b/test/heronArea/heronArea.test.js new file mode 100644 index 000000000..e323009ef --- /dev/null +++ b/test/heronArea/heronArea.test.js @@ -0,0 +1,6 @@ +const expect = require('expect'); +const heronArea = require('./heronArea.js'); + +test('heronArea is a Function', () => { + expect(heronArea).toBeInstanceOf(Function); +}); diff --git a/test/testlog b/test/testlog index c62e8658b..8b3507e5a 100644 --- a/test/testlog +++ b/test/testlog @@ -1,7 +1,7 @@ # Starting... -# 360 test suites found. +# 362 test suites found. # PASS test/uniqueElements/uniqueElements.test.js @@ -473,6 +473,16 @@ not ok 317 ● isDuplexStream returns true for write streams ok 318 — isDuplexStream returns true for duplex streams ok 319 — isDuplexStream returns false for non-streams +# FAIL test/getImages/getImages.test.js + +# +# 16 | expect(getImages(TEST_HTML, false).length).toBeLessThanOrEqual(getImages(TEST_HTML, true).length); +# +# 17 | expect(getImages(TEST_HTML, true)).toEqual(expect.arrayContaining(getImages(TEST_HTML, false))); +# > 18 | });\n +# | ^ +# 19 | + # PASS test/sampleSize/sampleSize.test.js ok 320 — sampleSize is a Function @@ -643,20 +653,20 @@ ok 418 — Works for arrays with multiple value ok 419 — Works for strings ok 420 — Works for objects -# PASS test/binarySearch/binarySearch.test.js - -ok 421 — binarySearch is a Function -ok 422 — Finds item in array -ok 423 — Returns -1 when not found -ok 424 — Works with empty arrays -ok 425 — Works for one element arrays - # PASS test/randomHexColorCode/randomHexColorCode.test.js -ok 426 — randomHexColorCode is a Function -ok 427 — randomHexColorCode has to proper length -ok 428 — The color code starts with "#" -ok 429 — The color code contains only valid hex-digits +ok 421 — randomHexColorCode is a Function +ok 422 — randomHexColorCode has to proper length +ok 423 — The color code starts with "#" +ok 424 — The color code contains only valid hex-digits + +# PASS test/binarySearch/binarySearch.test.js + +ok 425 — binarySearch is a Function +ok 426 — Finds item in array +ok 427 — Returns -1 when not found +ok 428 — Works with empty arrays +ok 429 — Works for one element arrays # PASS test/inRange/inRange.test.js @@ -733,20 +743,20 @@ ok 472 — Returns the correct year ok 473 — Returns the correct month ok 474 — Returns the correct date -# PASS test/prettyBytes/prettyBytes.test.js - -ok 475 — prettyBytes is a Function -ok 476 — Converts a number in bytes to a human-readable string. -ok 477 — Converts a number in bytes to a human-readable string. -ok 478 — Converts a number in bytes to a human-readable string. - # PASS test/shuffle/shuffle.test.js -ok 479 — shuffle is a Function -ok 480 — Shuffles the array -ok 481 — New array contains all original elements -ok 482 — Works for empty arrays -ok 483 — Works for single-element arrays +ok 475 — shuffle is a Function +ok 476 — Shuffles the array +ok 477 — New array contains all original elements +ok 478 — Works for empty arrays +ok 479 — Works for single-element arrays + +# PASS test/prettyBytes/prettyBytes.test.js + +ok 480 — prettyBytes is a Function +ok 481 — Converts a number in bytes to a human-readable string. +ok 482 — Converts a number in bytes to a human-readable string. +ok 483 — Converts a number in bytes to a human-readable string. # PASS test/stringPermutations/stringPermutations.test.js @@ -838,16 +848,16 @@ ok 532 — CSVToJSON is a Function ok 533 — CSVToJSON works with default delimiter ok 534 — CSVToJSON works with custom delimiter -# PASS test/URLJoin/URLJoin.test.js - -ok 535 — URLJoin is a Function -ok 536 — Returns proper URL -ok 537 — Returns proper URL - # PASS test/reducedFilter/reducedFilter.test.js -ok 538 — reducedFilter is a Function -ok 539 — Filter an array of objects based on a condition while also filtering out unspecified keys. +ok 535 — reducedFilter is a Function +ok 536 — Filter an array of objects based on a condition while also filtering out unspecified keys. + +# PASS test/URLJoin/URLJoin.test.js + +ok 537 — URLJoin is a Function +ok 538 — Returns proper URL +ok 539 — Returns proper URL # PASS test/unzip/unzip.test.js @@ -868,18 +878,18 @@ ok 547 — Works for a single letter ok 548 — Works for a common string ok 549 — Works for emoji -# PASS test/uniqueSymmetricDifference/uniqueSymmetricDifference.test.js - -ok 550 — uniqueSymmetricDifference is a Function -ok 551 — Returns the symmetric difference between two arrays. -ok 552 — Does not return duplicates from one array - # PASS test/isAbsoluteURL/isAbsoluteURL.test.js -ok 553 — isAbsoluteURL is a Function -ok 554 — Given string is an absolute URL -ok 555 — Given string is an absolute URL -ok 556 — Given string is not an absolute URL +ok 550 — isAbsoluteURL is a Function +ok 551 — Given string is an absolute URL +ok 552 — Given string is an absolute URL +ok 553 — Given string is not an absolute URL + +# PASS test/uniqueSymmetricDifference/uniqueSymmetricDifference.test.js + +ok 554 — uniqueSymmetricDifference is a Function +ok 555 — Returns the symmetric difference between two arrays. +ok 556 — Does not return duplicates from one array # PASS test/matches/matches.test.js @@ -887,17 +897,17 @@ ok 557 — matches is a Function ok 558 — Matches returns true for two similar objects ok 559 — Matches returns false for two non-similar objects -# PASS test/uncurry/uncurry.test.js - -ok 560 — uncurry is a Function -ok 561 — Works without a provided value for n -ok 562 — Works with n = 2 -ok 563 — Works with n = 3 - # PASS test/collectInto/collectInto.test.js -ok 564 — collectInto is a Function -ok 565 — Works with multiple promises +ok 560 — collectInto is a Function +ok 561 — Works with multiple promises + +# PASS test/uncurry/uncurry.test.js + +ok 562 — uncurry is a Function +ok 563 — Works without a provided value for n +ok 564 — Works with n = 2 +ok 565 — Works with n = 3 # PASS test/isValidJSON/isValidJSON.test.js @@ -986,43 +996,43 @@ ok 608 — isBeforeDate produces the correct result ok 609 — intersectionWith is a Function ok 610 — Returns a list of elements that exist in both arrays, using a provided comparator function -# PASS test/sample/sample.test.js +# PASS test/pipeAsyncFunctions/pipeAsyncFunctions.test.js -ok 611 — sample is a Function -ok 612 — Returns a random element from the array -ok 613 — Works for single-element arrays -ok 614 — Returns undefined for empty array +ok 611 — pipeAsyncFunctions is a Function +ok 612 — pipeAsyncFunctions result should be 15 # PASS test/flattenObject/flattenObject.test.js -ok 615 — flattenObject is a Function -ok 616 — Flattens an object with the paths for keys -ok 617 — Works with arrays +ok 613 — flattenObject is a Function +ok 614 — Flattens an object with the paths for keys +ok 615 — Works with arrays # PASS test/nthArg/nthArg.test.js -ok 618 — nthArg is a Function -ok 619 — Returns the nth argument -ok 620 — Returns undefined if arguments too few -ok 621 — Works for negative values +ok 616 — nthArg is a Function +ok 617 — Returns the nth argument +ok 618 — Returns undefined if arguments too few +ok 619 — Works for negative values -# PASS test/pipeAsyncFunctions/pipeAsyncFunctions.test.js +# PASS test/sample/sample.test.js -ok 622 — pipeAsyncFunctions is a Function -ok 623 — pipeAsyncFunctions result should be 15 - -# PASS test/drop/drop.test.js - -ok 624 — drop is a Function -ok 625 — Works without the last argument -ok 626 — Removes appropriate element count as specified -ok 627 — Empties array given a count greater than length +ok 620 — sample is a Function +ok 621 — Returns a random element from the array +ok 622 — Works for single-element arrays +ok 623 — Returns undefined for empty array # PASS test/isAfterDate/isAfterDate.test.js -ok 628 — isAfterDate is a Function -ok 629 — isAfterDate produces the correct result -ok 630 — isBeforeDate produces the correct result +ok 624 — isAfterDate is a Function +ok 625 — isAfterDate produces the correct result +ok 626 — isBeforeDate produces the correct result + +# PASS test/drop/drop.test.js + +ok 627 — drop is a Function +ok 628 — Works without the last argument +ok 629 — Removes appropriate element count as specified +ok 630 — Empties array given a count greater than length # PASS test/functions/functions.test.js @@ -1041,19 +1051,19 @@ ok 636 — Works with arrow function and objects ok 637 — renameKeys is a Function ok 638 — renameKeys is a Function -# PASS test/elo/elo.test.js - -ok 639 — elo is a Function -ok 640 — Standard 1v1s -ok 641 — Standard 1v1s -ok 642 — 4 player FFA, all same rank - # PASS test/memoize/memoize.test.js -ok 643 — memoize is a Function -ok 644 — Function works properly -ok 645 — Function works properly -ok 646 — Cache stores values +ok 639 — memoize is a Function +ok 640 — Function works properly +ok 641 — Function works properly +ok 642 — Cache stores values + +# PASS test/elo/elo.test.js + +ok 643 — elo is a Function +ok 644 — Standard 1v1s +ok 645 — Standard 1v1s +ok 646 — 4 player FFA, all same rank # PASS test/isLowerCase/isLowerCase.test.js @@ -1079,45 +1089,45 @@ ok 656 — Produces the right result with a property name ok 657 — bindKey is a Function ok 658 — Binds function to an object context -# PASS test/symmetricDifferenceBy/symmetricDifferenceBy.test.js - -ok 659 — symmetricDifferenceBy is a Function -ok 660 — Returns the symmetric difference between two arrays, after applying the provided function to each array element of both - # PASS test/isPromiseLike/isPromiseLike.test.js -ok 661 — isPromiseLike is a Function -ok 662 — Returns true for a promise-like object -ok 663 — Returns false for an empty object +ok 659 — isPromiseLike is a Function +ok 660 — Returns true for a promise-like object +ok 661 — Returns false for an empty object + +# PASS test/symmetricDifferenceBy/symmetricDifferenceBy.test.js + +ok 662 — symmetricDifferenceBy is a Function +ok 663 — Returns the symmetric difference between two arrays, after applying the provided function to each array element of both # PASS test/findLastKey/findLastKey.test.js ok 664 — findLastKey is a Function ok 665 — eturns the appropriate key -# PASS test/isArrayLike/isArrayLike.test.js - -ok 666 — isArrayLike is a Function -ok 667 — Returns true for a string -ok 668 — Returns true for an array -ok 669 — Returns false for null - # PASS test/arrayToCSV/arrayToCSV.test.js -ok 670 — arrayToCSV is a Function -ok 671 — arrayToCSV works with default delimiter -ok 672 — arrayToCSV works with custom delimiter +ok 666 — arrayToCSV is a Function +ok 667 — arrayToCSV works with default delimiter +ok 668 — arrayToCSV works with custom delimiter -# PASS test/promisify/promisify.test.js +# PASS test/isArrayLike/isArrayLike.test.js -ok 673 — promisify is a Function -ok 674 — Returns a promise -ok 675 — Runs the function provided +ok 669 — isArrayLike is a Function +ok 670 — Returns true for a string +ok 671 — Returns true for an array +ok 672 — Returns false for null # PASS test/truthCheckCollection/truthCheckCollection.test.js -ok 676 — truthCheckCollection is a Function -ok 677 — second argument is truthy on all elements of a collection +ok 673 — truthCheckCollection is a Function +ok 674 — second argument is truthy on all elements of a collection + +# PASS test/promisify/promisify.test.js + +ok 675 — promisify is a Function +ok 676 — Returns a promise +ok 677 — Runs the function provided # PASS test/isUpperCase/isUpperCase.test.js @@ -1132,15 +1142,15 @@ ok 682 — pullAtValue is a Function ok 683 — Pulls the specified values ok 684 — Pulls the specified values -# PASS test/maxBy/maxBy.test.js +# PASS test/minBy/minBy.test.js -ok 685 — maxBy is a Function +ok 685 — minBy is a Function ok 686 — Produces the right result with a function ok 687 — Produces the right result with a property name -# PASS test/minBy/minBy.test.js +# PASS test/maxBy/maxBy.test.js -ok 688 — minBy is a Function +ok 688 — maxBy is a Function ok 689 — Produces the right result with a function ok 690 — Produces the right result with a property name @@ -1202,45 +1212,45 @@ ok 713 — Returns an object containing the parameters of the current URL ok 714 — reduceSuccessive is a Function ok 715 — Returns the array of successively reduced values -# PASS test/isPlainObject/isPlainObject.test.js - -ok 716 — isPlainObject is a Function -ok 717 — Returns true for a plain object -ok 718 — Returns false for a Map (example of non-plain object) - # PASS test/runPromisesInSeries/runPromisesInSeries.test.js -ok 719 — runPromisesInSeries is a Function -ok 720 — Runs promises in series +ok 716 — runPromisesInSeries is a Function +ok 717 — Runs promises in series # PASS test/intersectionBy/intersectionBy.test.js -ok 721 — intersectionBy is a Function -ok 722 — Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both +ok 718 — intersectionBy is a Function +ok 719 — Returns a list of elements that exist in both arrays, after applying the provided function to each array element of both -# PASS test/indexOfAll/indexOfAll.test.js +# PASS test/isPlainObject/isPlainObject.test.js -ok 723 — indexOfAll is a Function -ok 724 — Returns all indices of val in an array -ok 725 — When val is not found, return an empty array +ok 720 — isPlainObject is a Function +ok 721 — Returns true for a plain object +ok 722 — Returns false for a Map (example of non-plain object) # PASS test/isNil/isNil.test.js -ok 726 — isNil is a Function -ok 727 — Returns true for null -ok 728 — Returns true for undefined -ok 729 — Returns false for an empty string +ok 723 — isNil is a Function +ok 724 — Returns true for null +ok 725 — Returns true for undefined +ok 726 — Returns false for an empty string -# PASS test/gcd/gcd.test.js +# PASS test/indexOfAll/indexOfAll.test.js -ok 730 — gcd is a Function -ok 731 — Calculates the greatest common divisor between two or more numbers/arrays -ok 732 — Calculates the greatest common divisor between two or more numbers/arrays +ok 727 — indexOfAll is a Function +ok 728 — Returns all indices of val in an array +ok 729 — When val is not found, return an empty array # PASS test/pipeFunctions/pipeFunctions.test.js -ok 733 — pipeFunctions is a Function -ok 734 — Performs left-to-right function composition +ok 730 — pipeFunctions is a Function +ok 731 — Performs left-to-right function composition + +# PASS test/gcd/gcd.test.js + +ok 732 — gcd is a Function +ok 733 — Calculates the greatest common divisor between two or more numbers/arrays +ok 734 — Calculates the greatest common divisor between two or more numbers/arrays # PASS test/extendHex/extendHex.test.js @@ -1285,16 +1295,16 @@ ok 751 — countBy is a Function ok 752 — Works for functions ok 753 — Works for property names -# PASS test/decapitalize/decapitalize.test.js - -ok 754 — decapitalize is a Function -ok 755 — Works with default parameter -ok 756 — Works with second parameter set to true - # PASS test/overArgs/overArgs.test.js -ok 757 — overArgs is a Function -ok 758 — Invokes the provided function with its arguments transformed +ok 754 — overArgs is a Function +ok 755 — Invokes the provided function with its arguments transformed + +# PASS test/decapitalize/decapitalize.test.js + +ok 756 — decapitalize is a Function +ok 757 — Works with default parameter +ok 758 — Works with second parameter set to true # PASS test/shallowClone/shallowClone.test.js @@ -1302,21 +1312,21 @@ ok 759 — shallowClone is a Function ok 760 — Shallow cloning works ok 761 — Does not clone deeply +# PASS test/spreadOver/spreadOver.test.js + +ok 762 — spreadOver is a Function +ok 763 — Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. + # PASS test/nthElement/nthElement.test.js -ok 762 — nthElement is a Function -ok 763 — Returns the nth element of an array. -ok 764 — Returns the nth element of an array. +ok 764 — nthElement is a Function +ok 765 — Returns the nth element of an array. +ok 766 — Returns the nth element of an array. # PASS test/hashNode/hashNode.test.js -ok 765 — hashNode is a Function -ok 766 — Produces the appropriate hash - -# PASS test/spreadOver/spreadOver.test.js - -ok 767 — spreadOver is a Function -ok 768 — Takes a variadic function and returns a closure that accepts an array of arguments to map to the inputs of the function. +ok 767 — hashNode is a Function +ok 768 — Produces the appropriate hash # PASS test/partialRight/partialRight.test.js @@ -1333,16 +1343,16 @@ ok 772 — Performs left-to-right function composition ok 773 — permutations is a Function ok 774 — Generates all permutations of an array -# PASS test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js - -ok 775 — getDaysDiffBetweenDates is a Function -ok 776 — Returns the difference in days between two dates - # PASS test/maxN/maxN.test.js -ok 777 — maxN is a Function -ok 778 — Returns the n maximum elements from the provided array -ok 779 — Returns the n maximum elements from the provided array +ok 775 — maxN is a Function +ok 776 — Returns the n maximum elements from the provided array +ok 777 — Returns the n maximum elements from the provided array + +# PASS test/getDaysDiffBetweenDates/getDaysDiffBetweenDates.test.js + +ok 778 — getDaysDiffBetweenDates is a Function +ok 779 — Returns the difference in days between two dates # PASS test/minN/minN.test.js @@ -1424,15 +1434,15 @@ ok 812 — palindrome is a Function ok 813 — Given string is a palindrome ok 814 — Given string is not a palindrome -# PASS test/bifurcateBy/bifurcateBy.test.js - -ok 815 — bifurcateBy is a Function -ok 816 — Splits the collection into two groups - # PASS test/degreesToRads/degreesToRads.test.js -ok 817 — degreesToRads is a Function -ok 818 — Returns the appropriate value +ok 815 — degreesToRads is a Function +ok 816 — Returns the appropriate value + +# PASS test/bifurcateBy/bifurcateBy.test.js + +ok 817 — bifurcateBy is a Function +ok 818 — Splits the collection into two groups # PASS test/size/size.test.js @@ -1440,16 +1450,16 @@ ok 819 — size is a Function ok 820 — Get size of arrays, objects or strings. ok 821 — Get size of arrays, objects or strings. -# PASS test/median/median.test.js - -ok 822 — median is a Function -ok 823 — Returns the median of an array of numbers -ok 824 — Returns the median of an array of numbers - # PASS test/bifurcate/bifurcate.test.js -ok 825 — bifurcate is a Function -ok 826 — Splits the collection into two groups +ok 822 — bifurcate is a Function +ok 823 — Splits the collection into two groups + +# PASS test/median/median.test.js + +ok 824 — median is a Function +ok 825 — Returns the median of an array of numbers +ok 826 — Returns the median of an array of numbers # PASS test/forOwnRight/forOwnRight.test.js @@ -1461,16 +1471,16 @@ ok 828 — Iterates over an element's key-value pairs in reverse ok 829 — sortedIndexBy is a Function ok 830 — Returns the lowest index to insert the element without messing up the list order -# PASS test/attempt/attempt.test.js - -ok 831 — attempt is a Function -ok 832 — Returns a value -ok 833 — Returns an error - # PASS test/dropRightWhile/dropRightWhile.test.js -ok 834 — dropRightWhile is a Function -ok 835 — Removes elements from the end of an array until the passed function returns true. +ok 831 — dropRightWhile is a Function +ok 832 — Removes elements from the end of an array until the passed function returns true. + +# PASS test/attempt/attempt.test.js + +ok 833 — attempt is a Function +ok 834 — Returns a value +ok 835 — Returns an error # PASS test/sortedLastIndex/sortedLastIndex.test.js @@ -1492,16 +1502,16 @@ ok 841 — Unescapes escaped HTML characters. ok 842 — pickBy is a Function ok 843 — Creates an object composed of the properties the given function returns truthy for. -# PASS test/flip/flip.test.js - -ok 844 — flip is a Function -ok 845 — Flips argument order - # PASS test/isFunction/isFunction.test.js -ok 846 — isFunction is a Function -ok 847 — passed value is a function -ok 848 — passed value is not a function +ok 844 — isFunction is a Function +ok 845 — passed value is a function +ok 846 — passed value is not a function + +# PASS test/flip/flip.test.js + +ok 847 — flip is a Function +ok 848 — Flips argument order # PASS test/sortCharactersInString/sortCharactersInString.test.js @@ -1570,15 +1580,15 @@ ok 874 — Creates an object from the given key-value pairs. ok 875 — forEachRight is a Function ok 876 — Iterates over the array in reverse -# PASS test/xProd/xProd.test.js - -ok 877 — xProd is a Function -ok 878 — xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] - # PASS test/stripHTMLTags/stripHTMLTags.test.js -ok 879 — stripHTMLTags is a Function -ok 880 — Removes HTML tags +ok 877 — stripHTMLTags is a Function +ok 878 — Removes HTML tags + +# PASS test/xProd/xProd.test.js + +ok 879 — xProd is a Function +ok 880 — xProd([1, 2], ['a', 'b']) returns [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] # PASS test/objectToPairs/objectToPairs.test.js @@ -1616,20 +1626,20 @@ ok 893 — Filters out the non-unique values in an array ok 894 — ary is a Function ok 895 — Discards arguments with index >=n -# PASS test/forOwn/forOwn.test.js - -ok 896 — forOwn is a Function -ok 897 — Iterates over an element's key-value pairs - # PASS test/takeRightWhile/takeRightWhile.test.js -ok 898 — takeRightWhile is a Function -ok 899 — Removes elements until the function returns true +ok 896 — takeRightWhile is a Function +ok 897 — Removes elements until the function returns true -# PASS test/removeNonASCII/removeNonASCII.test.js +# PASS test/forOwn/forOwn.test.js -ok 900 — removeNonASCII is a Function -ok 901 — Removes non-ASCII characters +ok 898 — forOwn is a Function +ok 899 — Iterates over an element's key-value pairs + +# PASS test/countOccurrences/countOccurrences.test.js + +ok 900 — countOccurrences is a Function +ok 901 — Counts the occurrences of a value in an array # PASS test/curry/curry.test.js @@ -1637,10 +1647,10 @@ ok 902 — curry is a Function ok 903 — curries a Math.pow ok 904 — curries a Math.min -# PASS test/countOccurrences/countOccurrences.test.js +# PASS test/removeNonASCII/removeNonASCII.test.js -ok 905 — countOccurrences is a Function -ok 906 — Counts the occurrences of a value in an array +ok 905 — removeNonASCII is a Function +ok 906 — Removes non-ASCII characters # PASS test/dropWhile/dropWhile.test.js @@ -1663,36 +1673,36 @@ ok 913 — Picks the key-value pairs corresponding to the given keys from an obj ok 914 — truncateString is a Function ok 915 — Truncates a "boomerang" up to a specified length. -# PASS test/defaults/defaults.test.js - -ok 916 — defaults is a Function -ok 917 — Assigns default values for undefined properties - # PASS test/remove/remove.test.js -ok 918 — remove is a Function -ok 919 — Removes elements from an array for which the given function returns false +ok 916 — remove is a Function +ok 917 — Removes elements from an array for which the given function returns false -# PASS test/atob/atob.test.js +# PASS test/defaults/defaults.test.js -ok 920 — atob is a Function -ok 921 — atob("Zm9vYmFy") equals "foobar" -ok 922 — atob("Z") returns "" - -# PASS test/delay/delay.test.js - -ok 923 — delay is a Function -ok 924 — Works as expecting, passing arguments properly - -# PASS test/intersection/intersection.test.js - -ok 925 — intersection is a Function -ok 926 — Returns a list of elements that exist in both arrays +ok 918 — defaults is a Function +ok 919 — Assigns default values for undefined properties # PASS test/clampNumber/clampNumber.test.js -ok 927 — clampNumber is a Function -ok 928 — Clamps num within the inclusive range specified by the boundary values a and b +ok 920 — clampNumber is a Function +ok 921 — Clamps num within the inclusive range specified by the boundary values a and b + +# PASS test/delay/delay.test.js + +ok 922 — delay is a Function +ok 923 — Works as expecting, passing arguments properly + +# PASS test/intersection/intersection.test.js + +ok 924 — intersection is a Function +ok 925 — Returns a list of elements that exist in both arrays + +# PASS test/atob/atob.test.js + +ok 926 — atob is a Function +ok 927 — atob("Zm9vYmFy") equals "foobar" +ok 928 — atob("Z") returns "" # PASS test/parseCookie/parseCookie.test.js @@ -1714,15 +1724,15 @@ ok 934 — Returns an array of elements that appear in both arrays. ok 935 — over is a Function ok 936 — Applies given functions over multiple arguments -# PASS test/findLast/findLast.test.js - -ok 937 — findLast is a Function -ok 938 — Finds last element for which the given function returns true - # PASS test/pull/pull.test.js -ok 939 — pull is a Function -ok 940 — Pulls the specified values +ok 937 — pull is a Function +ok 938 — Pulls the specified values + +# PASS test/findLast/findLast.test.js + +ok 939 — findLast is a Function +ok 940 — Finds last element for which the given function returns true # PASS test/isEven/isEven.test.js @@ -1730,40 +1740,40 @@ ok 941 — isEven is a Function ok 942 — 4 is even number ok 943 — 5 is not an even number +# PASS test/cloneRegExp/cloneRegExp.test.js + +ok 944 — cloneRegExp is a Function +ok 945 — Clones regular expressions properly + # PASS test/takeWhile/takeWhile.test.js -ok 944 — takeWhile is a Function -ok 945 — Removes elements until the function returns true +ok 946 — takeWhile is a Function +ok 947 — Removes elements until the function returns true # PASS test/escapeRegExp/escapeRegExp.test.js -ok 946 — escapeRegExp is a Function -ok 947 — Escapes a string to use in a regular expression - -# PASS test/cloneRegExp/cloneRegExp.test.js - -ok 948 — cloneRegExp is a Function -ok 949 — Clones regular expressions properly - -# PASS test/times/times.test.js - -ok 950 — times is a Function -ok 951 — Runs a function the specified amount of times +ok 948 — escapeRegExp is a Function +ok 949 — Escapes a string to use in a regular expression # PASS test/coalesce/coalesce.test.js -ok 952 — coalesce is a Function -ok 953 — Returns the first non-null/undefined argument +ok 950 — coalesce is a Function +ok 951 — Returns the first non-null/undefined argument -# PASS test/powerset/powerset.test.js +# PASS test/times/times.test.js -ok 954 — powerset is a Function -ok 955 — Returns the powerset of a given array of numbers. +ok 952 — times is a Function +ok 953 — Runs a function the specified amount of times # PASS test/fibonacci/fibonacci.test.js -ok 956 — fibonacci is a Function -ok 957 — Generates an array, containing the Fibonacci sequence +ok 954 — fibonacci is a Function +ok 955 — Generates an array, containing the Fibonacci sequence + +# PASS test/powerset/powerset.test.js + +ok 956 — powerset is a Function +ok 957 — Returns the powerset of a given array of numbers. # PASS test/hammingDistance/hammingDistance.test.js @@ -1780,16 +1790,16 @@ ok 961 — Generates primes up to a given number, using the Sieve of Eratosthene ok 962 — distance is a Function ok 963 — Calculates the distance between two points -# PASS test/tail/tail.test.js - -ok 964 — tail is a Function -ok 965 — Returns tail -ok 966 — Returns tail - # PASS test/difference/difference.test.js -ok 967 — difference is a Function -ok 968 — Returns the difference between two arrays +ok 964 — difference is a Function +ok 965 — Returns the difference between two arrays + +# PASS test/tail/tail.test.js + +ok 966 — tail is a Function +ok 967 — Returns tail +ok 968 — Returns tail # PASS test/serializeCookie/serializeCookie.test.js @@ -1816,30 +1826,30 @@ ok 976 — Negates a predicate function ok 977 — everyNth is a Function ok 978 — Returns every nth element in an array -# PASS test/unionBy/unionBy.test.js - -ok 979 — unionBy is a Function -ok 980 — Produces the appropriate results - # PASS test/initial/initial.test.js -ok 981 — initial is a Function -ok 982 — Returns all the elements of an array except the last one +ok 979 — initial is a Function +ok 980 — Returns all the elements of an array except the last one + +# PASS test/unionBy/unionBy.test.js + +ok 981 — unionBy is a Function +ok 982 — Produces the appropriate results # PASS test/radsToDegrees/radsToDegrees.test.js ok 983 — radsToDegrees is a Function ok 984 — Returns the appropriate value -# PASS test/unary/unary.test.js - -ok 985 — unary is a Function -ok 986 — Discards arguments after the first one - # PASS test/sleep/sleep.test.js -ok 987 — sleep is a Function -ok 988 — Works as expected +ok 985 — sleep is a Function +ok 986 — Works as expected + +# PASS test/unary/unary.test.js + +ok 987 — unary is a Function +ok 988 — Discards arguments after the first one # PASS test/mapKeys/mapKeys.test.js @@ -1910,13 +1920,13 @@ ok 1013 — btoa("foobar") equals "Zm9vYmFy" ok 1014 — isPrime is a Function ok 1015 — passed number is a prime -# PASS test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js - -ok 1016 — getMeridiemSuffixOfInteger is a Function - # PASS test/elementIsVisibleInViewport/elementIsVisibleInViewport.test.js -ok 1017 — elementIsVisibleInViewport is a Function +ok 1016 — elementIsVisibleInViewport is a Function + +# PASS test/getMeridiemSuffixOfInteger/getMeridiemSuffixOfInteger.test.js + +ok 1017 — getMeridiemSuffixOfInteger is a Function # PASS test/fibonacciCountUntilNum/fibonacciCountUntilNum.test.js @@ -1926,13 +1936,13 @@ ok 1018 — fibonacciCountUntilNum is a Function ok 1019 — recordAnimationFrames is a Function -# PASS test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js - -ok 1020 — UUIDGeneratorBrowser is a Function - # PASS test/getColonTimeFromDate/getColonTimeFromDate.test.js -ok 1021 — getColonTimeFromDate is a Function +ok 1020 — getColonTimeFromDate is a Function + +# PASS test/UUIDGeneratorBrowser/UUIDGeneratorBrowser.test.js + +ok 1021 — UUIDGeneratorBrowser is a Function # PASS test/levenshteinDistance/levenshteinDistance.test.js @@ -1946,9 +1956,9 @@ ok 1023 — isBrowserTabFocused is a Function ok 1024 — onUserInputChange is a Function -# PASS test/initializeNDArray/initializeNDArray.test.js +# PASS test/fibonacciUntilNum/fibonacciUntilNum.test.js -ok 1025 — initializeNDArray is a Function +ok 1025 — fibonacciUntilNum is a Function # PASS test/getScrollPosition/getScrollPosition.test.js @@ -1958,37 +1968,37 @@ ok 1026 — getScrollPosition is a Function ok 1027 — isArmstrongNumber is a Function -# PASS test/fibonacciUntilNum/fibonacciUntilNum.test.js +# PASS test/initializeNDArray/initializeNDArray.test.js -ok 1028 — fibonacciUntilNum is a Function - -# PASS test/detectDeviceType/detectDeviceType.test.js - -ok 1029 — detectDeviceType is a Function +ok 1028 — initializeNDArray is a Function # PASS test/observeMutations/observeMutations.test.js -ok 1030 — observeMutations is a Function +ok 1029 — observeMutations is a Function -# PASS test/copyToClipboard/copyToClipboard.test.js +# PASS test/detectDeviceType/detectDeviceType.test.js -ok 1031 — copyToClipboard is a Function - -# PASS test/elementContains/elementContains.test.js - -ok 1032 — elementContains is a Function +ok 1030 — detectDeviceType is a Function # PASS test/nodeListToArray/nodeListToArray.test.js -ok 1033 — nodeListToArray is a Function +ok 1031 — nodeListToArray is a Function + +# PASS test/arrayToHtmlList/arrayToHtmlList.test.js + +ok 1032 — arrayToHtmlList is a Function + +# PASS test/elementContains/elementContains.test.js + +ok 1033 — elementContains is a Function # PASS test/speechSynthesis/speechSynthesis.test.js ok 1034 — speechSynthesis is a Function -# PASS test/arrayToHtmlList/arrayToHtmlList.test.js +# PASS test/copyToClipboard/copyToClipboard.test.js -ok 1035 — arrayToHtmlList is a Function +ok 1035 — copyToClipboard is a Function # PASS test/mostPerformant/mostPerformant.test.js @@ -2006,57 +2016,57 @@ ok 1038 — readFileLines is a Function ok 1039 — createElement is a Function -# PASS test/bottomVisible/bottomVisible.test.js - -ok 1040 — bottomVisible is a Function - # PASS test/httpsRedirect/httpsRedirect.test.js -ok 1041 — httpsRedirect is a Function +ok 1040 — httpsRedirect is a Function # PASS test/isArrayBuffer/isArrayBuffer.test.js -ok 1042 — isArrayBuffer is a Function +ok 1041 — isArrayBuffer is a Function -# PASS test/insertBefore/insertBefore.test.js +# PASS test/bottomVisible/bottomVisible.test.js -ok 1043 — insertBefore is a Function +ok 1042 — bottomVisible is a Function + +# PASS test/smoothScroll/smoothScroll.test.js + +ok 1043 — smoothScroll is a Function # PASS test/howManyTimes/howManyTimes.test.js ok 1044 — howManyTimes is a Function +# PASS test/insertBefore/insertBefore.test.js + +ok 1045 — insertBefore is a Function + # PASS test/removeVowels/removeVowels.test.js -ok 1045 — removeVowels is a Function - -# PASS test/smoothScroll/smoothScroll.test.js - -ok 1046 — smoothScroll is a Function - -# PASS test/isTypedArray/isTypedArray.test.js - -ok 1047 — isTypedArray is a Function +ok 1046 — removeVowels is a Function # PASS test/triggerEvent/triggerEvent.test.js -ok 1048 — triggerEvent is a Function +ok 1047 — triggerEvent is a Function + +# PASS test/isTypedArray/isTypedArray.test.js + +ok 1048 — isTypedArray is a Function # PASS test/countVowels/countVowels.test.js ok 1049 — countVowels is a Function -# PASS test/toggleClass/toggleClass.test.js +# PASS test/hashBrowser/hashBrowser.test.js -ok 1050 — toggleClass is a Function +ok 1050 — hashBrowser is a Function # PASS test/insertAfter/insertAfter.test.js ok 1051 — insertAfter is a Function -# PASS test/hashBrowser/hashBrowser.test.js +# PASS test/toggleClass/toggleClass.test.js -ok 1052 — hashBrowser is a Function +ok 1052 — toggleClass is a Function # PASS test/scrollToTop/scrollToTop.test.js @@ -2066,167 +2076,171 @@ ok 1053 — scrollToTop is a Function ok 1054 — currentURL is a Function -# PASS test/JSONToFile/JSONToFile.test.js +# PASS test/httpDelete/httpDelete.test.js -ok 1055 — JSONToFile is a Function +ok 1055 — httpDelete is a Function # PASS test/JSONToDate/JSONToDate.test.js ok 1056 — JSONToDate is a Function -# PASS test/httpDelete/httpDelete.test.js +# PASS test/JSONToFile/JSONToFile.test.js -ok 1057 — httpDelete is a Function - -# PASS test/isWeakMap/isWeakMap.test.js - -ok 1058 — isWeakMap is a Function +ok 1057 — JSONToFile is a Function # PASS test/isSimilar/isSimilar.test.js -ok 1059 — isSimilar is a Function +ok 1058 — isSimilar is a Function + +# PASS test/isBrowser/isBrowser.test.js + +ok 1059 — isBrowser is a Function # PASS test/dayOfYear/dayOfYear.test.js ok 1060 — dayOfYear is a Function -# PASS test/timeTaken/timeTaken.test.js +# PASS test/isWeakMap/isWeakMap.test.js -ok 1061 — timeTaken is a Function +ok 1061 — isWeakMap is a Function + +# PASS test/heronArea/heronArea.test.js + +ok 1062 — heronArea is a Function # PASS test/isWeakSet/isWeakSet.test.js -ok 1062 — isWeakSet is a Function +ok 1063 — isWeakSet is a Function -# PASS test/isBrowser/isBrowser.test.js +# PASS test/timeTaken/timeTaken.test.js -ok 1063 — isBrowser is a Function - -# PASS test/hasClass/hasClass.test.js - -ok 1064 — hasClass is a Function - -# PASS test/hasFlags/hasFlags.test.js - -ok 1065 — hasFlags is a Function - -# PASS test/throttle/throttle.test.js - -ok 1066 — throttle is a Function - -# PASS test/runAsync/runAsync.test.js - -ok 1067 — runAsync is a Function - -# PASS test/redirect/redirect.test.js - -ok 1068 — redirect is a Function - -# PASS test/httpPost/httpPost.test.js - -ok 1069 — httpPost is a Function - -# PASS test/getStyle/getStyle.test.js - -ok 1070 — getStyle is a Function - -# PASS test/isRegExp/isRegExp.test.js - -ok 1071 — isRegExp is a Function - -# PASS test/colorize/colorize.test.js - -ok 1072 — colorize is a Function - -# PASS test/setStyle/setStyle.test.js - -ok 1073 — setStyle is a Function +ok 1064 — timeTaken is a Function # PASS test/solveRPN/solveRPN.test.js -ok 1074 — solveRPN is a Function +ok 1065 — solveRPN is a Function + +# PASS test/isRegExp/isRegExp.test.js + +ok 1066 — isRegExp is a Function + +# PASS test/colorize/colorize.test.js + +ok 1067 — colorize is a Function + +# PASS test/runAsync/runAsync.test.js + +ok 1068 — runAsync is a Function + +# PASS test/hasFlags/hasFlags.test.js + +ok 1069 — hasFlags is a Function + +# PASS test/httpPost/httpPost.test.js + +ok 1070 — httpPost is a Function + +# PASS test/throttle/throttle.test.js + +ok 1071 — throttle is a Function + +# PASS test/hasClass/hasClass.test.js + +ok 1072 — hasClass is a Function + +# PASS test/redirect/redirect.test.js + +ok 1073 — redirect is a Function + +# PASS test/setStyle/setStyle.test.js + +ok 1074 — setStyle is a Function + +# PASS test/getStyle/getStyle.test.js + +ok 1075 — getStyle is a Function # PASS test/pipeLog/pipeLog.test.js -ok 1075 — pipeLog is a Function - -# PASS test/counter/counter.test.js - -ok 1076 — counter is a Function +ok 1076 — pipeLog is a Function # PASS test/zipWith/zipWith.test.js ok 1077 — zipWith is a Function -# PASS test/factors/factors.test.js +# PASS test/counter/counter.test.js -ok 1078 — factors is a Function - -# PASS test/httpPut/httpPut.test.js - -ok 1079 — httpPut is a Function +ok 1078 — counter is a Function # PASS test/httpGet/httpGet.test.js -ok 1080 — httpGet is a Function +ok 1079 — httpGet is a Function + +# PASS test/httpPut/httpPut.test.js + +ok 1080 — httpPut is a Function + +# PASS test/factors/factors.test.js + +ok 1081 — factors is a Function # PASS test/prefix/prefix.test.js -ok 1081 — prefix is a Function +ok 1082 — prefix is a Function # PASS test/toHash/toHash.test.js -ok 1082 — toHash is a Function +ok 1083 — toHash is a Function -# PASS test/isSet/isSet.test.js +# PASS test/isMap/isMap.test.js -ok 1083 — isSet is a Function - -# PASS test/defer/defer.test.js - -ok 1084 — defer is a Function +ok 1084 — isMap is a Function # PASS test/sumBy/sumBy.test.js ok 1085 — sumBy is a Function -# PASS test/isMap/isMap.test.js +# PASS test/isSet/isSet.test.js -ok 1086 — isMap is a Function +ok 1086 — isSet is a Function -# PASS test/show/show.test.js +# PASS test/defer/defer.test.js -ok 1087 — show is a Function - -# PASS test/nest/nest.test.js - -ok 1088 — nest is a Function +ok 1087 — defer is a Function # PASS test/once/once.test.js -ok 1089 — once is a Function +ok 1088 — once is a Function + +# PASS test/show/show.test.js + +ok 1089 — show is a Function + +# PASS test/nest/nest.test.js + +ok 1090 — nest is a Function # PASS test/hide/hide.test.js -ok 1090 — hide is a Function +ok 1091 — hide is a Function # PASS test/off/off.test.js -ok 1091 — off is a Function - -# PASS test/hz/hz.test.js - -ok 1092 — hz is a Function +ok 1092 — off is a Function # PASS test/on/on.test.js ok 1093 — on is a Function -1..1093 +# PASS test/hz/hz.test.js -# Test Suites: 100% ██████████, 1 failed, 359 passed, 360 total -# Tests: 100% ██████████, 2 failed, 1091 passed, 1093 total -# Time: 28.070s +ok 1094 — hz is a Function + +1..1094 + +# Test Suites: 99% ██████████, 2 failed, 360 passed, 362 total +# Tests: 100% ██████████, 2 failed, 1092 passed, 1094 total +# Time: 26.219s # Ran all test suites. From c8c60895e80b8bc90583502accdaa339b794609c Mon Sep 17 00:00:00 2001 From: Felix Wu Date: Mon, 8 Oct 2018 20:46:04 +0200 Subject: [PATCH 3/4] Update README-start.md --- static-parts/README-start.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static-parts/README-start.md b/static-parts/README-start.md index 860bc982f..db678a1d7 100644 --- a/static-parts/README-start.md +++ b/static-parts/README-start.md @@ -2,8 +2,9 @@ # 30 seconds of code -[![License](https://img.shields.io/badge/license-CC0--1.0-blue.svg)](https://github.com/30-seconds/30-seconds-of-code/blob/master/LICENSE) [![npm Downloads](https://img.shields.io/npm/dt/30-seconds-of-code.svg)](https://www.npmjs.com/package/30-seconds-of-code) [![npm Version](https://img.shields.io/npm/v/30-seconds-of-code.svg)](https://www.npmjs.com/package/30-seconds-of-code) [![Gitter chat](https://img.shields.io/badge/chat-on%20gitter-4FB999.svg)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.com/30-seconds/30-seconds-of-code.svg?branch=master)](https://travis-ci.com/30-seconds/30-seconds-of-code) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6ab7791fb1ea40b4a576d658fb96807f)](https://www.codacy.com/app/Chalarangelo/30-seconds-of-code?utm_source=github.com&utm_medium=referral&utm_content=30-seconds/30-seconds-of-code&utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/4b8c1e099135f2d53413/maintainability)](https://codeclimate.com/github/30-seconds/30-seconds-of-code/maintainability) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/Flet/semistandard) [![Known Vulnerabilities](https://snyk.io/test/github/30-seconds/30-seconds-of-code/badge.svg?targetFile=package.json)](https://snyk.io/test/github/30-seconds/30-seconds-of-code?targetFile=package.json) [![ProductHunt](https://img.shields.io/badge/producthunt-vote-orange.svg)](https://www.producthunt.com/posts/30-seconds-of-code) +> *This README is built using [markdown-builder](https://github.com/30-seconds/markdown-builder).* +[![License](https://img.shields.io/badge/license-CC0--1.0-blue.svg)](https://github.com/30-seconds/30-seconds-of-code/blob/master/LICENSE) [![npm Downloads](https://img.shields.io/npm/dt/30-seconds-of-code.svg)](https://www.npmjs.com/package/30-seconds-of-code) [![npm Version](https://img.shields.io/npm/v/30-seconds-of-code.svg)](https://www.npmjs.com/package/30-seconds-of-code) [![Gitter chat](https://img.shields.io/badge/chat-on%20gitter-4FB999.svg)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.com/30-seconds/30-seconds-of-code.svg?branch=master)](https://travis-ci.com/30-seconds/30-seconds-of-code) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6ab7791fb1ea40b4a576d658fb96807f)](https://www.codacy.com/app/Chalarangelo/30-seconds-of-code?utm_source=github.com&utm_medium=referral&utm_content=30-seconds/30-seconds-of-code&utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/4b8c1e099135f2d53413/maintainability)](https://codeclimate.com/github/30-seconds/30-seconds-of-code/maintainability) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/Flet/semistandard) [![Known Vulnerabilities](https://snyk.io/test/github/30-seconds/30-seconds-of-code/badge.svg?targetFile=package.json)](https://snyk.io/test/github/30-seconds/30-seconds-of-code?targetFile=package.json) [![ProductHunt](https://img.shields.io/badge/producthunt-vote-orange.svg)](https://www.producthunt.com/posts/30-seconds-of-code) > Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less. From dd49cfb58e28d1124af16a2a8692ca3567036049 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Mon, 8 Oct 2018 18:47:47 +0000 Subject: [PATCH 4/4] Travis build: 615 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f59de281..559283983 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ # 30 seconds of code -[![License](https://img.shields.io/badge/license-CC0--1.0-blue.svg)](https://github.com/30-seconds/30-seconds-of-code/blob/master/LICENSE) [![npm Downloads](https://img.shields.io/npm/dt/30-seconds-of-code.svg)](https://www.npmjs.com/package/30-seconds-of-code) [![npm Version](https://img.shields.io/npm/v/30-seconds-of-code.svg)](https://www.npmjs.com/package/30-seconds-of-code) [![Gitter chat](https://img.shields.io/badge/chat-on%20gitter-4FB999.svg)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.com/30-seconds/30-seconds-of-code.svg?branch=master)](https://travis-ci.com/30-seconds/30-seconds-of-code) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6ab7791fb1ea40b4a576d658fb96807f)](https://www.codacy.com/app/Chalarangelo/30-seconds-of-code?utm_source=github.com&utm_medium=referral&utm_content=30-seconds/30-seconds-of-code&utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/4b8c1e099135f2d53413/maintainability)](https://codeclimate.com/github/30-seconds/30-seconds-of-code/maintainability) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/Flet/semistandard) [![Known Vulnerabilities](https://snyk.io/test/github/30-seconds/30-seconds-of-code/badge.svg?targetFile=package.json)](https://snyk.io/test/github/30-seconds/30-seconds-of-code?targetFile=package.json) [![ProductHunt](https://img.shields.io/badge/producthunt-vote-orange.svg)](https://www.producthunt.com/posts/30-seconds-of-code) +> *This README is built using [markdown-builder](https://github.com/30-seconds/markdown-builder).* +[![License](https://img.shields.io/badge/license-CC0--1.0-blue.svg)](https://github.com/30-seconds/30-seconds-of-code/blob/master/LICENSE) [![npm Downloads](https://img.shields.io/npm/dt/30-seconds-of-code.svg)](https://www.npmjs.com/package/30-seconds-of-code) [![npm Version](https://img.shields.io/npm/v/30-seconds-of-code.svg)](https://www.npmjs.com/package/30-seconds-of-code) [![Gitter chat](https://img.shields.io/badge/chat-on%20gitter-4FB999.svg)](https://gitter.im/30-seconds-of-code/Lobby) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) [![Travis Build](https://travis-ci.com/30-seconds/30-seconds-of-code.svg?branch=master)](https://travis-ci.com/30-seconds/30-seconds-of-code) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/6ab7791fb1ea40b4a576d658fb96807f)](https://www.codacy.com/app/Chalarangelo/30-seconds-of-code?utm_source=github.com&utm_medium=referral&utm_content=30-seconds/30-seconds-of-code&utm_campaign=Badge_Grade) [![Maintainability](https://api.codeclimate.com/v1/badges/4b8c1e099135f2d53413/maintainability)](https://codeclimate.com/github/30-seconds/30-seconds-of-code/maintainability) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/Flet/semistandard) [![Known Vulnerabilities](https://snyk.io/test/github/30-seconds/30-seconds-of-code/badge.svg?targetFile=package.json)](https://snyk.io/test/github/30-seconds/30-seconds-of-code?targetFile=package.json) [![ProductHunt](https://img.shields.io/badge/producthunt-vote-orange.svg)](https://www.producthunt.com/posts/30-seconds-of-code) > Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.