forked from a-synchronous/rubico
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
63 lines (57 loc) · 1.83 KB
/
index.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
/**
* rubico v1.5.19
* https://github.com/a-synchronous/rubico
* (c) 2019-2020 Richard Tong
* rubico may be freely distributed under the MIT license.
*/
(function (root, rubico) {
if (typeof module == 'object') (module.exports = rubico) // CommonJS
else if (typeof define == 'function') define(() => rubico) // AMD
else (root.rubico = rubico) // Browser
}(typeof globalThis == 'object' ? globalThis : this, (function () {
/**
* design principles
*
* rubico is a module, not a utility library
* 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
*/
'use strict'
const pipe = require('./pipe')
const fork = require('./fork')
const assign = require('./assign')
const tap = require('./tap')
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 any = require('./any')
const all = require('./all')
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 pick = require('./pick')
const omit = require('./omit')
return {
pipe, fork, assign,
tap, tryCatch, switchCase,
map, filter, reduce, transform, flatMap,
any, all, and, or, not,
eq, gt, lt, gte, lte,
get, pick, omit,
}
}())))