Travis build: 1497
This commit is contained in:
34
README.md
34
README.md
@ -1723,8 +1723,8 @@ const join = (arr, separator = ',', end = separator) =>
|
||||
i === arr.length - 2
|
||||
? acc + val + end
|
||||
: i === arr.length - 1
|
||||
? acc + val
|
||||
: acc + val + separator,
|
||||
? acc + val
|
||||
: acc + val + separator,
|
||||
''
|
||||
);
|
||||
```
|
||||
@ -4272,10 +4272,10 @@ const getMeridiemSuffixOfInteger = num =>
|
||||
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';
|
||||
```
|
||||
|
||||
<details>
|
||||
@ -5487,11 +5487,11 @@ Throws an exception if `n` is a negative number.
|
||||
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);
|
||||
```
|
||||
|
||||
<details>
|
||||
@ -6702,8 +6702,8 @@ const deepClone = obj => {
|
||||
return Array.isArray(obj) && obj.length
|
||||
? (clone.length = obj.length) && Array.from(clone)
|
||||
: Array.isArray(obj)
|
||||
? Array.from(obj)
|
||||
: clone;
|
||||
? Array.from(obj)
|
||||
: clone;
|
||||
};
|
||||
```
|
||||
|
||||
@ -6791,13 +6791,13 @@ const deepMapKeys = (obj, f) =>
|
||||
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;
|
||||
```
|
||||
|
||||
<details>
|
||||
@ -6868,9 +6868,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);
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
Reference in New Issue
Block a user