forked from jtextor/dagitty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode-pre.js
102 lines (98 loc) · 2.58 KB
/
node-pre.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
const __ = require("underscore")
const _ = {
"pluck" : (arr, key) => arr.map(obj => obj[key]),
"extend" : function(destination, ...sources){
for (const source of sources) {
for (const key in source) {
if (source.hasOwnProperty(key)) {
destination[key] = source[key];
}
}
}
return destination;
},
"isArray" : v => Array.isArray(v),
"isNumber" : v => typeof v === 'number',
"isString" : v => typeof v === 'string',
"isUndefined" : v => typeof v === 'undefined',
"contains" : function(obj, item, fromIndex, guard){
return __.contains(obj, item, fromIndex, guard)
},
"find" : function(obj,predicate,context){
return __.find(obj,predicate,context)
},
"filter" : function(obj,predicate,context){
return __.filter(obj,predicate,context)
},
"compact" : function(array){
return __.compact(array)
},
"every" : function(){
return __.every.apply( this, arguments )
},
"all" : function(){
return __.all.apply( this, arguments )
},
"max" : function(){
return __.max.apply( this, arguments )
},
"chain" : function(){
return __.chain.apply( this, arguments )
},
"difference" : function(){
return __.difference.apply( this, arguments )
},
"intersection" : function(){
return __.intersection.apply( this, arguments )
},
"keys" : function(){
return __.keys.apply( this, arguments )
},
"isNull" : function(){
return __.isNull.apply( this, arguments )
},
"any" : function(){
return __.any.apply( this, arguments )
},
"defaults" : function(){
return __.defaults.apply( this, arguments )
},
"reduce" : function(){
return __.reduce.apply( this, arguments )
},
"without" : function(){
return __.without.apply( this, arguments )
},
"some" : function(obj,predicate,context){
return __.some(obj,predicate,context)
},
"reject" : function(obj,predicate,context){
return __.reject(obj,predicate,context)
},
"union" : function(){
return __.union.apply( this, arguments )
},
"uniq" : function( array, isSorted, iteratee, context ){
return __.uniq(array, isSorted, iteratee, context)
},
"map" : function(obj, iteratee, context){
return __.map(obj,iteratee,context)
},
"each" : function(obj, iteratee, context) {
__.each( obj, iteratee, context )
}
/* function(collection, iteratee, ctx){
if( Array.isArray( collection ) ){
let i, length
for( i = 0 , length = collection.length ; i < length ; i ++ ){
iteratee(collection[i], i, collection)
}
} else {
for( const key in collection ){
if( collection.hasOwnProperty( key ) ){
iteratee(collection[key], key, collection)
}
}
}
} */
};