Travis build: 1072

This commit is contained in:
30secondsofcode
2019-03-19 07:41:59 +00:00
parent 63a70ee86d
commit fdfb1a9b52
9 changed files with 32 additions and 19 deletions

View File

@ -8,7 +8,9 @@ Omit the second argument, `delimiter`, to use a default delimiter of `,`.
```js
const arrayToCSV = (arr, delimiter = ',') =>
arr.map(v => v.map(x => isNaN(x) ? `"${x.replace(/"/g, '""')}"` : x ).join(delimiter)).join('\n');
arr
.map(v => v.map(x => (isNaN(x) ? `"${x.replace(/"/g, '""')}"` : x)).join(delimiter))
.join('\n');
```
```js

View File

@ -10,6 +10,7 @@ const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);
```js
const lengthIs4 = checkProp(l => l === 4, 'length');
lengthIs4([]); // false
lengthIs4([1,2,3,4]); // true

View File

@ -17,7 +17,7 @@ const sum = pipeAsyncFunctions(
x => x + 3,
async x => (await x) + 4
);
(async () => {
(async() => {
console.log(await sum(5)); // 15 (after one second)
})();
```

View File

@ -9,9 +9,9 @@ The `func` is invoked with three arguments (`value, index, array`).
const remove = (arr, func) =>
Array.isArray(arr)
? arr.filter(func).reduce((acc, val) => {
arr.splice(arr.indexOf(val), 1);
return acc.concat(val);
}, [])
arr.splice(arr.indexOf(val), 1);
return acc.concat(val);
}, [])
: [];
```