-
Notifications
You must be signed in to change notification settings - Fork 15
/
rubico.js
66 lines (55 loc) · 1.66 KB
/
rubico.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const pipe = require('./pipe')
const compose = require('./compose')
const tap = require('./tap')
const all = require('./all')
const assign = require('./assign')
const tryCatch = require('./tryCatch')
const switchCase = require('./switchCase')
const map = require('./map')
const filter = require('./filter')
const reduce = require('./reduce')
const transform = require('./transform')
const flatMap = require('./flatMap')
const forEach = require('./forEach')
const some = require('./some')
const every = require('./every')
const and = require('./and')
const or = require('./or')
const not = require('./not')
const eq = require('./eq')
const gt = require('./gt')
const lt = require('./lt')
const gte = require('./gte')
const lte = require('./lte')
const get = require('./get')
const set = require('./set')
const pick = require('./pick')
const omit = require('./omit')
const thunkify = require('./thunkify')
const always = require('./always')
const curry = require('./curry')
const __ = require('./__')
/**
* design principles
*
* rubico is a module, not a grab bag
* functional code should not care about async
* exported methods are time and space optimal
* memory used by exported methods is properly garbage collected
* no special types; use built-in types
* avoid variadic functions; use lists
* avoid anonymous function creation; use names and factory functions
* avoid creating functions inside functions
*/
const rubico = {
pipe, compose,
tap, forEach,
switchCase,
tryCatch,
all, assign, get, set, pick, omit,
map, filter, flatMap, reduce, transform,
and, or, not, some, every,
eq, gt, lt, gte, lte,
thunkify, always, curry, __,
}
module.exports = rubico