From 82757c05b0bbe1190ff842b46c8dfd04213e8cdf Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Thu, 17 Jan 2019 14:51:26 +0000 Subject: [PATCH] Travis build: 963 [cron] --- dist/_30s.esm.js | 10 +++++----- dist/_30s.js | 10 +++++----- snippet_data/snippetList.json | 8 ++++---- snippet_data/snippets.json | 12 ++++++------ vscode_snippets/snippets.json | 10 +++++----- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dist/_30s.esm.js b/dist/_30s.esm.js index cb4bf552c..f08cdfc45 100644 --- a/dist/_30s.esm.js +++ b/dist/_30s.esm.js @@ -264,9 +264,9 @@ const dig = (obj, target) => target in obj ? obj[target] : Object.values(obj).reduce((acc, val) => { - if (acc !== undefined) return acc; - if (typeof val === 'object') return dig(val, target); - }, undefined); + if (acc !== undefined) return acc; + if (typeof val === 'object') return dig(val, target); + }, undefined); const digitize = n => [...`${n}`].map(i => parseInt(i)); const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0); const drop = (arr, n = 1) => arr.slice(n); @@ -338,8 +338,8 @@ const extendHex = shortHex => const factorial = n => n < 0 ? (() => { - throw new TypeError('Negative numbers are not allowed!'); - })() + throw new TypeError('Negative numbers are not allowed!'); + })() : n <= 1 ? 1 : n * factorial(n - 1); diff --git a/dist/_30s.js b/dist/_30s.js index 82d842ab0..6b906e92b 100644 --- a/dist/_30s.js +++ b/dist/_30s.js @@ -270,9 +270,9 @@ target in obj ? obj[target] : Object.values(obj).reduce((acc, val) => { - if (acc !== undefined) return acc; - if (typeof val === 'object') return dig(val, target); - }, undefined); + if (acc !== undefined) return acc; + if (typeof val === 'object') return dig(val, target); + }, undefined); const digitize = n => [...`${n}`].map(i => parseInt(i)); const distance = (x0, y0, x1, y1) => Math.hypot(x1 - x0, y1 - y0); const drop = (arr, n = 1) => arr.slice(n); @@ -344,8 +344,8 @@ const factorial = n => n < 0 ? (() => { - throw new TypeError('Negative numbers are not allowed!'); - })() + throw new TypeError('Negative numbers are not allowed!'); + })() : n <= 1 ? 1 : n * factorial(n - 1); diff --git a/snippet_data/snippetList.json b/snippet_data/snippetList.json index 5c1d9a01a..577e53ce8 100644 --- a/snippet_data/snippetList.json +++ b/snippet_data/snippetList.json @@ -941,7 +941,7 @@ "archived": false }, "meta": { - "hash": "f982b4e8e3ec3c8b0c2ef4f19b38dac90df6ebe2dd4daa0126c917ebc07d3e62" + "hash": "828a6f2f3b94cc537ef0ee30c5ebda28fff688fea65030e47d5721831bdb48ce" } }, { @@ -1162,7 +1162,7 @@ "archived": false }, "meta": { - "hash": "319e1a8fb41490965ee6e28db3e139e65c4ea5b7f43e332bc7216cd790e5d409" + "hash": "383ed61e69b8f63ae42d0746a1995057f4f65b4af6ca7778d8f1771144802acd" } }, { @@ -3377,7 +3377,7 @@ "archived": false }, "meta": { - "hash": "0b04f5fe668888db0dc360535cd999669258019f0682eb6e4ad3a1164e408d13" + "hash": "4815876fd6dbb17ad34c0d8918e7a72d837104f9beee7dc51b0fa73057b9e83e" } }, { @@ -3749,7 +3749,7 @@ "archived": false }, "meta": { - "hash": "536833a64ce0c000b82327ed1bb9bcb82e35b237f75aefcca0e0d2def4e9cb63" + "hash": "ec9cb9384817f84cf0bacd62a23b69b2304fa2cf0352b16d3950b21d48c04f11" } }, { diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index 812d40d7c..b5224d470 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -1377,7 +1377,7 @@ "fileName": "dig.md", "text": "Returns the target value in a nested JSON object, based on the given key.\n\nUse the `in` operator to check if `target` exists in `obj`.\nIf found, return the value of `obj[target]`, otherwise use `Object.values(obj)` and `Array.prototype.reduce()` to recursively call `dig` on each nested object until the first matching key/value pair is found.", "codeBlocks": { - "es6": "const dig = (obj, target) =>\n target in obj\n ? obj[target]\n : Object.values(obj).reduce((acc, val) => {\n if (acc !== undefined) return acc;\n if (typeof val === 'object') return dig(val, target);\n }, undefined);", + "es6": "const dig = (obj, target) =>\n target in obj\n ? obj[target]\n : Object.values(obj).reduce((acc, val) => {\n if (acc !== undefined) return acc;\n if (typeof val === 'object') return dig(val, target);\n }, undefined);", "es5": "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar dig = function dig(obj, target) {\n return target in obj ? obj[target] : Object.values(obj).reduce(function (acc, val) {\n if (acc !== undefined) return acc;\n if (_typeof(val) === 'object') return dig(val, target);\n }, undefined);\n};", "example": "const data = {\n level1: {\n level2: {\n level3: 'some data'\n }\n }\n};\ndig(data, 'level3'); // 'some data'\ndig(data, 'level4'); // undefined" }, @@ -1389,7 +1389,7 @@ }, "meta": { "archived": false, - "hash": "f982b4e8e3ec3c8b0c2ef4f19b38dac90df6ebe2dd4daa0126c917ebc07d3e62" + "hash": "828a6f2f3b94cc537ef0ee30c5ebda28fff688fea65030e47d5721831bdb48ce" } }, { @@ -1703,7 +1703,7 @@ "fileName": "factorial.md", "text": "Calculates the factorial of a number.\n\nUse recursion.\nIf `n` is less than or equal to `1`, return `1`.\nOtherwise, return the product of `n` and the factorial of `n - 1`.\nThrows an exception if `n` is a negative number.", "codeBlocks": { - "es6": "const factorial = n =>\n n < 0\n ? (() => {\n throw new TypeError('Negative numbers are not allowed!');\n })()\n : n <= 1\n ? 1\n : n * factorial(n - 1);", + "es6": "const factorial = n =>\n n < 0\n ? (() => {\n throw new TypeError('Negative numbers are not allowed!');\n })()\n : n <= 1\n ? 1\n : n * factorial(n - 1);", "es5": "var factorial = function factorial(n) {\n return n < 0 ? function () {\n throw new TypeError('Negative numbers are not allowed!');\n }() : n <= 1 ? 1 : n * factorial(n - 1);\n};", "example": "factorial(6); // 720" }, @@ -1715,7 +1715,7 @@ }, "meta": { "archived": false, - "hash": "319e1a8fb41490965ee6e28db3e139e65c4ea5b7f43e332bc7216cd790e5d409" + "hash": "383ed61e69b8f63ae42d0746a1995057f4f65b4af6ca7778d8f1771144802acd" } }, { @@ -4973,7 +4973,7 @@ }, "meta": { "archived": false, - "hash": "0b04f5fe668888db0dc360535cd999669258019f0682eb6e4ad3a1164e408d13" + "hash": "4815876fd6dbb17ad34c0d8918e7a72d837104f9beee7dc51b0fa73057b9e83e" } }, { @@ -5520,7 +5520,7 @@ }, "meta": { "archived": false, - "hash": "536833a64ce0c000b82327ed1bb9bcb82e35b237f75aefcca0e0d2def4e9cb63" + "hash": "ec9cb9384817f84cf0bacd62a23b69b2304fa2cf0352b16d3950b21d48c04f11" } }, { diff --git a/vscode_snippets/snippets.json b/vscode_snippets/snippets.json index 6ee98992a..267f9055c 100644 --- a/vscode_snippets/snippets.json +++ b/vscode_snippets/snippets.json @@ -614,9 +614,9 @@ " target in obj", " ? obj[target]", " : Object.values(obj).reduce((acc, val) => {", - " if (acc !== undefined) return acc;", - " if (typeof val === 'object') return dig(val, target);", - " }, undefined);" + " if (acc !== undefined) return acc;", + " if (typeof val === 'object') return dig(val, target);", + " }, undefined);" ], "description": "Returns the target value in a nested JSON object, based on the given key.\n\nUse the `in` operator to check if `target` exists in `obj`.\nIf found, return the value of `obj[target]`, otherwise use `Object.values(obj)` and `Array.prototype.reduce()` to recursively call `dig` on each nested object until the first matching key/value pair is found" }, @@ -778,8 +778,8 @@ "const factorial = n =>", " n < 0", " ? (() => {", - " throw new TypeError('Negative numbers are not allowed!');", - " })()", + " throw new TypeError('Negative numbers are not allowed!');", + " })()", " : n <= 1", " ? 1", " : n * factorial(n - 1);"