Travis build: 1670
This commit is contained in:
@ -1037,7 +1037,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "484bd222e636e8a8409c30ddb1fe6e3fe72ab7a43f2edf089b2758d5e9bee528"
|
||||
"hash": "bdc202436bee09f06a353d31841c6cfff33e8efead34c6c56ae1a1413284976d"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1273,7 +1273,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "0eac852db7a7add352b0d36677b22718b342ed9dc12f11780cac87e3b8260a05"
|
||||
"hash": "6e9710c9117f500e74e65c0ee36b39fb80bd55537fa5ff9c4b1136b2667096f2"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1678,7 +1678,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "9e39c6a3a8ec5b51c5e16f69107fc9e90b2697b2cf2689850872071bb968723e"
|
||||
"hash": "f9e6687cc28cd80e68f7a6776f893c7478aaa942710e0eb7144f105eba574a54"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -2599,6 +2599,21 @@
|
||||
"hash": "8a9ef17eda1a977bdd1149a4a782d7d0e7addd8c6db8d4bd3734c9269863b12c"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "isPowerOfTwo",
|
||||
"type": "snippetListing",
|
||||
"title": "isPowerOfTwo",
|
||||
"attributes": {
|
||||
"text": "Returns `true` if the given number is a power of `2`, `false` otherwise.\n\nUse the bitwise binary AND operator (`&`) to determine if `n is a power of `2. \nAdditionally, check that `n` is not falsy.\n\n",
|
||||
"tags": [
|
||||
"math",
|
||||
"beginner"
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "93dcd24b208880ba16d9aa32e59e718187cb4178cadb5876a4bc7c588ddcdebd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "isPrime",
|
||||
"type": "snippetListing",
|
||||
@ -2864,7 +2879,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "362fddaa6244404741e84bca6fc442a101fdb642af53b299e8b9994d0d7162d8"
|
||||
"hash": "3db3faac666ee61ab86c70766d2ab5d1293ffd818da87edb971bfff7a366364a"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3425,7 +3440,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "b031c3387ef66411ab5d295788eac4247ada5b4b068dda90603d3c973890bc26"
|
||||
"hash": "e8f820ce6da97eabde082ffb829c9fb700e85efc79bdebe883c67237269e3f52"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -3774,7 +3789,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "17bcf3f13980b7f804d9f0fe274324b2a35ab7d479c03d77322dabba81e1a34a"
|
||||
"hash": "7ccbf66d8d55c60bcf12baa980cf32d67a4ba567894d59e2d798c9af792424ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4171,7 +4186,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "069472d018c3102412dafc2ae8ec6e9396e53c01d0073079f2e3f1ac3c99b6e9"
|
||||
"hash": "c1542907e6295eb81df918174c247a65d73c8daccc56769f2eb32d609b7846fc"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -4487,7 +4502,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "24b93b68a59b49f245590930fed6fb82e286ce09f90e292466cde63c1784c347"
|
||||
"hash": "6dd4c6a51d2c80fa4768c95ae01c16a8359c4140bcad28c7fde0cecd72d7d3e2"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@ -1693,10 +1693,10 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "484bd222e636e8a8409c30ddb1fe6e3fe72ab7a43f2edf089b2758d5e9bee528",
|
||||
"hash": "bdc202436bee09f06a353d31841c6cfff33e8efead34c6c56ae1a1413284976d",
|
||||
"firstSeen": "1531080384",
|
||||
"lastUpdated": "1577785133",
|
||||
"updateCount": 89,
|
||||
"lastUpdated": "1577785478",
|
||||
"updateCount": 90,
|
||||
"authorCount": 5
|
||||
}
|
||||
},
|
||||
@ -2079,10 +2079,10 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "0eac852db7a7add352b0d36677b22718b342ed9dc12f11780cac87e3b8260a05",
|
||||
"hash": "6e9710c9117f500e74e65c0ee36b39fb80bd55537fa5ff9c4b1136b2667096f2",
|
||||
"firstSeen": "1512650493",
|
||||
"lastUpdated": "1577785133",
|
||||
"updateCount": 94,
|
||||
"lastUpdated": "1577785478",
|
||||
"updateCount": 95,
|
||||
"authorCount": 6
|
||||
}
|
||||
},
|
||||
@ -2744,10 +2744,10 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "9e39c6a3a8ec5b51c5e16f69107fc9e90b2697b2cf2689850872071bb968723e",
|
||||
"hash": "f9e6687cc28cd80e68f7a6776f893c7478aaa942710e0eb7144f105eba574a54",
|
||||
"firstSeen": "1515856488",
|
||||
"lastUpdated": "1577785133",
|
||||
"updateCount": 51,
|
||||
"lastUpdated": "1577785478",
|
||||
"updateCount": 52,
|
||||
"authorCount": 4
|
||||
}
|
||||
},
|
||||
@ -4249,6 +4249,31 @@
|
||||
"authorCount": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "isPowerOfTwo",
|
||||
"title": "isPowerOfTwo",
|
||||
"type": "snippet",
|
||||
"attributes": {
|
||||
"fileName": "isPowerOfTwo.md",
|
||||
"text": "Returns `true` if the given number is a power of `2`, `false` otherwise.\n\nUse the bitwise binary AND operator (`&`) to determine if `n is a power of `2. \nAdditionally, check that `n` is not falsy.\n\n",
|
||||
"codeBlocks": {
|
||||
"es6": "const isPowerOfTwo = n => !!n && (n & (n - 1)) == 0;",
|
||||
"es5": "var isPowerOfTwo = function isPowerOfTwo(n) {\n return !!n && (n & n - 1) == 0;\n};",
|
||||
"example": "isPowerOfTwo(0); // false\nisPowerOfTwo(1); // true\nisPowerOfTwo(8); // true"
|
||||
},
|
||||
"tags": [
|
||||
"math",
|
||||
"beginner"
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "93dcd24b208880ba16d9aa32e59e718187cb4178cadb5876a4bc7c588ddcdebd",
|
||||
"firstSeen": "1577791032",
|
||||
"lastUpdated": "1577791032",
|
||||
"updateCount": 2,
|
||||
"authorCount": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "isPrime",
|
||||
"title": "isPrime",
|
||||
@ -4680,10 +4705,10 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "362fddaa6244404741e84bca6fc442a101fdb642af53b299e8b9994d0d7162d8",
|
||||
"hash": "3db3faac666ee61ab86c70766d2ab5d1293ffd818da87edb971bfff7a366364a",
|
||||
"firstSeen": "1514801920",
|
||||
"lastUpdated": "1577785133",
|
||||
"updateCount": 57,
|
||||
"lastUpdated": "1577431401",
|
||||
"updateCount": 56,
|
||||
"authorCount": 7
|
||||
}
|
||||
},
|
||||
@ -5591,10 +5616,10 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "b031c3387ef66411ab5d295788eac4247ada5b4b068dda90603d3c973890bc26",
|
||||
"hash": "e8f820ce6da97eabde082ffb829c9fb700e85efc79bdebe883c67237269e3f52",
|
||||
"firstSeen": "1570824965",
|
||||
"lastUpdated": "1577785133",
|
||||
"updateCount": 24,
|
||||
"lastUpdated": "1577431401",
|
||||
"updateCount": 23,
|
||||
"authorCount": 4
|
||||
}
|
||||
},
|
||||
@ -6150,7 +6175,7 @@
|
||||
"codeBlocks": {
|
||||
"es6": "const pipeAsyncFunctions = (...fns) => arg => fns.reduce((p, f) => p.then(f), Promise.resolve(arg));",
|
||||
"es5": "var pipeAsyncFunctions = function pipeAsyncFunctions() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n\n return function (arg) {\n return fns.reduce(function (p, f) {\n return p.then(f);\n }, Promise.resolve(arg));\n };\n};",
|
||||
"example": "const sum = pipeAsyncFunctions(\n x => x + 1,\n x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)),\n x => x + 3,\n async x => (await x) + 4\n);\n(async() => {\n console.log(await sum(5)); // 15 (after one second)\n})();"
|
||||
"example": "const sum = pipeAsyncFunctions(\n x => x + 1,\n x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)),\n x => x + 3,\n async x => (await x) + 4\n);\n(async () => {\n console.log(await sum(5)); // 15 (after one second)\n})();"
|
||||
},
|
||||
"tags": [
|
||||
"adapter",
|
||||
@ -6160,10 +6185,10 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "17bcf3f13980b7f804d9f0fe274324b2a35ab7d479c03d77322dabba81e1a34a",
|
||||
"hash": "7ccbf66d8d55c60bcf12baa980cf32d67a4ba567894d59e2d798c9af792424ff",
|
||||
"firstSeen": "1517069864",
|
||||
"lastUpdated": "1577785133",
|
||||
"updateCount": 81,
|
||||
"lastUpdated": "1577431401",
|
||||
"updateCount": 80,
|
||||
"authorCount": 5
|
||||
}
|
||||
},
|
||||
@ -6807,10 +6832,10 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "069472d018c3102412dafc2ae8ec6e9396e53c01d0073079f2e3f1ac3c99b6e9",
|
||||
"hash": "c1542907e6295eb81df918174c247a65d73c8daccc56769f2eb32d609b7846fc",
|
||||
"firstSeen": "1513521691",
|
||||
"lastUpdated": "1577785133",
|
||||
"updateCount": 78,
|
||||
"lastUpdated": "1577431401",
|
||||
"updateCount": 77,
|
||||
"authorCount": 6
|
||||
}
|
||||
},
|
||||
@ -7323,10 +7348,10 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "24b93b68a59b49f245590930fed6fb82e286ce09f90e292466cde63c1784c347",
|
||||
"hash": "6dd4c6a51d2c80fa4768c95ae01c16a8359c4140bcad28c7fde0cecd72d7d3e2",
|
||||
"firstSeen": "1514645161",
|
||||
"lastUpdated": "1577785133",
|
||||
"updateCount": 23,
|
||||
"lastUpdated": "1577431401",
|
||||
"updateCount": 22,
|
||||
"authorCount": 5
|
||||
}
|
||||
},
|
||||
|
||||
@ -9,7 +9,7 @@ Use the bitwise binary AND operator (`&`) to determine if `n is a power of `2.
|
||||
Additionally, check that `n` is not falsy.
|
||||
|
||||
```js
|
||||
const isPowerOfTwo = n => !!n && ((n & (n - 1)) == 0);
|
||||
const isPowerOfTwo = n => !!n && (n & (n - 1)) == 0;
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
@ -11,7 +11,6 @@ Omit the second argument, `separator`, to use a default separator of `','`.
|
||||
Omit the third argument, `end`, to use the same value as `separator` by default.
|
||||
|
||||
```js
|
||||
|
||||
const join = (arr, separator = ',', end = separator) =>
|
||||
arr.reduce(
|
||||
(acc, val, i) =>
|
||||
|
||||
@ -10,7 +10,6 @@ Determine the `symbol` to be either `?` or `&` based on the `length` of `querySt
|
||||
Return the `queryString` or an empty string when the `queryParameters` are falsy.
|
||||
|
||||
```js
|
||||
|
||||
const objectToQueryString = queryParameters => {
|
||||
return queryParameters
|
||||
? Object.entries(queryParameters).reduce((queryString, [key, val], index) => {
|
||||
|
||||
@ -14,14 +14,13 @@ const pipeAsyncFunctions = (...fns) => arg => fns.reduce((p, f) => p.then(f), Pr
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
const sum = pipeAsyncFunctions(
|
||||
x => x + 1,
|
||||
x => new Promise(resolve => setTimeout(() => resolve(x + 2), 1000)),
|
||||
x => x + 3,
|
||||
async x => (await x) + 4
|
||||
);
|
||||
(async() => {
|
||||
(async () => {
|
||||
console.log(await sum(5)); // 15 (after one second)
|
||||
})();
|
||||
```
|
||||
@ -9,6 +9,7 @@ Use `Array.prototype.filter()` to find array elements that return truthy values
|
||||
The `func` is invoked with three arguments (`value, index, array`).
|
||||
|
||||
```js
|
||||
|
||||
const remove = (arr, func) =>
|
||||
Array.isArray(arr)
|
||||
? arr.filter(func).reduce((acc, val) => {
|
||||
|
||||
@ -12,7 +12,6 @@ Use `size` of a [`Blob` object](https://developer.mozilla.org/en-US/docs/Web/API
|
||||
Split strings into array of characters with `split('')` and return its length.
|
||||
|
||||
```js
|
||||
|
||||
const size = val =>
|
||||
Array.isArray(val)
|
||||
? val.length
|
||||
|
||||
@ -599,7 +599,7 @@ const isObject = obj => obj === Object(obj);
|
||||
const isObjectLike = val => val !== null && typeof val === 'object';
|
||||
const isOdd = num => num % 2 === 1;
|
||||
const isPlainObject = val => !!val && typeof val === 'object' && val.constructor === Object;
|
||||
const isPowerOfTwo = n => !!n && ((n & (n - 1)) == 0);
|
||||
const isPowerOfTwo = n => !!n && (n & (n - 1)) == 0;
|
||||
const isPrime = num => {
|
||||
const boundary = Math.floor(Math.sqrt(num));
|
||||
for (var i = 2; i <= boundary; i++) if (num % i === 0) return false;
|
||||
|
||||
@ -1587,6 +1587,13 @@
|
||||
],
|
||||
"description": "Checks if the provided value is an object created by the Object constructor.\n\nCheck if the provided value is truthy, use `typeof` to check if it is an object and `Object.constructor` to make sure the constructor is equal to `Object`.\n"
|
||||
},
|
||||
"isPowerOfTwo": {
|
||||
"prefix": "30s_isPowerOfTwo",
|
||||
"body": [
|
||||
"const isPowerOfTwo = n => !!n && (n & (n - 1)) == 0;"
|
||||
],
|
||||
"description": "Returns `true` if the given number is a power of `2`, `false` otherwise.\n\nUse the bitwise binary AND operator (`&`) to determine if `n is a power of `2. \nAdditionally, check that `n` is not falsy.\n"
|
||||
},
|
||||
"isPrime": {
|
||||
"prefix": "30s_isPrime",
|
||||
"body": [
|
||||
|
||||
Reference in New Issue
Block a user