@ebflat9/fp
Advanced tools
Comparing version 1.0.4 to 1.0.5
11
index.js
@@ -148,2 +148,3 @@ import { Maybe, Just, Nothing } from './maybe.js' | ||
// map, filter, reduce | ||
export const forEach = curry((f, M) => M.forEach(f)) | ||
export const map = curry((f, M) => M.map(f)) | ||
@@ -175,2 +176,3 @@ export const filter = curry((p, M) => M.filter(p)) | ||
// math functions | ||
export const eq = curry((a, b) => a === b) | ||
export const add = curry((x, y) => x + y) | ||
@@ -189,2 +191,4 @@ export const addRight = curry((x, y) => y + x) | ||
// array functions | ||
export const head = a => a[0] | ||
export const last = a => a[a.length - 1] | ||
export const every = curry((f, M) => M.every(f)) | ||
@@ -203,2 +207,9 @@ export const some = curry((f, M) => M.some(f)) | ||
) | ||
export const sortBy = curry((f, a) => [...a].sort(f)) | ||
export const match = curry((re, s) => re.test(s)) | ||
export const replace = curry((re, rpl, s) => s.replace(re, rpl)) | ||
export const split = curry((sep, s) => s.split(sep)) | ||
export const toLowerCase = s => s.toLowerCase() | ||
export const toUpperCase = s => s.toUpperCase() | ||
export const toString = String | ||
@@ -205,0 +216,0 @@ export const tryCatch = curry((f, g) => { |
{ | ||
"name": "@ebflat9/fp", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "my fp utils", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
36078
9
1295