Comparing version 0.9.2 to 0.10.0
{ | ||
"name": "absurdum", | ||
"version": "0.9.2", | ||
"version": "0.10.0", | ||
"description": "Reducio Ad Absurdum - The Riduculous Application of Reduce", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -41,2 +41,3 @@ [![npm](https://img.shields.io/npm/v/absurdum.svg)](https://www.npmjs.com/package/absurdum) | ||
- [endsWith][strings.endswith] | ||
- [padStart][strings.padStart] | ||
- [reverse][strings.reverse] | ||
@@ -47,2 +48,3 @@ - [startsWith][strings.startswith] | ||
[strings.endswith]: ./docs/strings.md#stringsendswithstring-substr | ||
[strings.padStart]: ./docs/strings.md#stringspadstartstring-length-substr | ||
[strings.reverse]: ./docs/strings.md#stringsreversestring | ||
@@ -49,0 +51,0 @@ [strings.startswith]: ./docs/strings.md#stringsstartswithstring-substr |
export const filter = (array, predicate) => { | ||
return array.reduce((acc, curr) => { | ||
return (predicate(curr)) ? acc.concat([curr]) : acc; | ||
if (predicate(curr)) { | ||
acc.push(curr); | ||
} | ||
return acc; | ||
}, []); | ||
}; |
export const map = (array, func) => { | ||
return array.reduce((acc, curr) => { | ||
return acc.concat([func(curr)]); | ||
acc.push(func(curr)); | ||
return acc; | ||
}, []); | ||
}; |
export const reverse = (array) => { | ||
return array.reduce((acc, curr, idx, arr) => { | ||
return acc.concat([arr[arr.length - idx - 1]]); | ||
acc.push(arr[arr.length - idx - 1]); | ||
return acc; | ||
}, []); | ||
}; |
export { endsWith } from './endsWith.js'; | ||
export { padStart } from './padStart.js'; | ||
export { reverse } from './reverse.js'; | ||
export { startsWith } from './startsWith.js'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14445
29
204
59