Travis build: 1413 [cron]

This commit is contained in:
30secondsofcode
2019-08-29 16:37:18 +00:00
parent 0a282d32f2
commit f3f77d5708
5 changed files with 71 additions and 71 deletions

View File

@ -511,8 +511,8 @@
" return Array.isArray(obj) && obj.length",
" ? (clone.length = obj.length) && Array.from(clone)",
" : Array.isArray(obj)",
" ? Array.from(obj)",
" : clone;",
" ? Array.from(obj)",
" : clone;",
"};"
],
"description": "Creates a deep clone of an object.\n\nUse recursion.\nUse `Object.assign()` and an empty object (`{}`) to create a shallow clone of the original.\nUse `Object.keys()` and `Array.prototype.forEach()` to determine which key-value pairs need to be deep cloned.\n"
@ -548,13 +548,13 @@
" Array.isArray(obj)",
" ? obj.map(val => deepMapKeys(val, f))",
" : typeof obj === 'object'",
" ? Object.keys(obj).reduce((acc, current) => {",
" ? Object.keys(obj).reduce((acc, current) => {",
" const val = obj[current];",
" acc[f(current)] =",
" val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);",
" return acc;",
" }, {})",
" : obj;"
" : obj;"
],
"description": "Deep maps an object's keys.\n\nCreates an object with the same values as the provided object and keys generated by running the provided function for each key.\nUse `Object.keys(obj)` to iterate over the object's keys. \nUse `Array.prototype.reduce()` to create a new object with the same values and mapped keys using `fn`.\n"
},
@ -630,9 +630,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.\n"
},
@ -795,11 +795,11 @@
"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);"
" ? 1",
" : n * factorial(n - 1);"
],
"description": "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.\n"
},
@ -1056,10 +1056,10 @@
" num === 0 || num === 24",
" ? 12 + 'am'",
" : num === 12",
" ? 12 + 'pm'",
" : num < 12",
" ? (num % 12) + 'am'",
" : (num % 12) + 'pm';"
" ? 12 + 'pm'",
" : num < 12",
" ? (num % 12) + 'am'",
" : (num % 12) + 'pm';"
],
"description": "Converts an integer to a suffixed string, adding `am` or `pm` based on its value.\n\nUse the modulo operator (`%`) and conditional checks to transform an integer to a stringified 12-hour format with meridiem suffix.\n"
},
@ -1706,8 +1706,8 @@
" i === arr.length - 2",
" ? acc + val + end",
" : i === arr.length - 1",
" ? acc + val",
" : acc + val + separator,",
" ? acc + val",
" : acc + val + separator,",
" ''",
" );"
],