conjur-asset-ui 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.git-hooks/pre_commit/ensure_livescript_compiled.rb +31 -0
- data/.git-hooks/pre_commit/trailing_whitespace.rb +26 -0
- data/.gitignore +20 -0
- data/.overcommit.yml +5 -0
- data/.project +18 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +41 -0
- data/Rakefile +3 -0
- data/compile_ls +6 -0
- data/conjur-asset-ui.gemspec +37 -0
- data/lib/conjur/command/ui.rb +46 -0
- data/lib/conjur/webserver/api_proxy.rb +94 -0
- data/lib/conjur/webserver/authorize.rb +28 -0
- data/lib/conjur/webserver/conjur_info.rb +33 -0
- data/lib/conjur/webserver/home.rb +42 -0
- data/lib/conjur/webserver/login.rb +57 -0
- data/lib/conjur/webserver/renderer.rb +34 -0
- data/lib/conjur/webserver/server.rb +113 -0
- data/lib/conjur-asset-ui-version.rb +7 -0
- data/lib/conjur-asset-ui.rb +7 -0
- data/livescript/views/audit.ls +136 -0
- data/public/_client_code.html +42 -0
- data/public/_client_libs.html +24 -0
- data/public/css/bootstrap.css +7 -0
- data/public/css/styles.less +461 -0
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.svg +229 -0
- data/public/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/images/conjur-logo.svg +26 -0
- data/public/images/icon-client-pc.svg +12 -0
- data/public/images/icon-environment.png +0 -0
- data/public/images/icon-person.svg +12 -0
- data/public/images/icon-policy.png +0 -0
- data/public/images/icon-resource.png +0 -0
- data/public/images/icon-service-dots.svg +13 -0
- data/public/images/icon-variable.png +0 -0
- data/public/index.html.erb +62 -0
- data/public/js/init.js +107 -0
- data/public/js/lib/JSXTransformer.js +10862 -0
- data/public/js/lib/async.js +958 -0
- data/public/js/lib/backbone.js +2 -0
- data/public/js/lib/bootstrap.js +6 -0
- data/public/js/lib/date.extensions.js +141 -0
- data/public/js/lib/less.js +16 -0
- data/public/js/lib/moment.js +7768 -0
- data/public/js/lib/pace.js +2 -0
- data/public/js/lib/prelude-browser-min.js +1 -0
- data/public/js/lib/react-bootstrap.js +5346 -0
- data/public/js/lib/react-bootstrap.min.js +4 -0
- data/public/js/lib/sorted-set.no-require.js +1170 -0
- data/public/js/lib/sorted-set.no-require.js.txt +6 -0
- data/public/js/lib/underscore-min.js +6 -0
- data/public/js/lib/underscore.string.min.js +1 -0
- data/public/js/main.js +57 -0
- data/public/js/models/groupRecord.js +70 -0
- data/public/js/models/hostRecord.js +55 -0
- data/public/js/models/layerRecord.js +77 -0
- data/public/js/models/namespace.js +10 -0
- data/public/js/models/policyList.js +14 -0
- data/public/js/models/policyRecord.js +54 -0
- data/public/js/models/record.js +85 -0
- data/public/js/models/resourceList.js +69 -0
- data/public/js/models/userList.js +20 -0
- data/public/js/models/userRecord.js +70 -0
- data/public/js/models/variableList.js +16 -0
- data/public/js/models/variableRecord.js +73 -0
- data/public/js/routers.js +205 -0
- data/public/js/views/annotations.js +36 -0
- data/public/js/views/audit.js +363 -0
- data/public/js/views/dashboard.js +67 -0
- data/public/js/views/generic.js +115 -0
- data/public/js/views/group.js +61 -0
- data/public/js/views/groups.js +30 -0
- data/public/js/views/host.js +64 -0
- data/public/js/views/hosts.js +30 -0
- data/public/js/views/layer.js +92 -0
- data/public/js/views/layers.js +30 -0
- data/public/js/views/mixins/search.js +15 -0
- data/public/js/views/mixins/tabs.js +114 -0
- data/public/js/views/namespaces.js +40 -0
- data/public/js/views/navSearch.js +25 -0
- data/public/js/views/owned.js +178 -0
- data/public/js/views/permissions.js +188 -0
- data/public/js/views/policies.js +28 -0
- data/public/js/views/policy.js +43 -0
- data/public/js/views/resource.js +39 -0
- data/public/js/views/role.js +41 -0
- data/public/js/views/searchResults.js +145 -0
- data/public/js/views/time.js +14 -0
- data/public/js/views/user.js +68 -0
- data/public/js/views/users.js +31 -0
- data/public/js/views/variable.js +70 -0
- data/public/js/views/variables.js +30 -0
- data/spec/javascripts/helpers/.gitkeep +0 -0
- data/spec/javascripts/support/jasmine.yml +112 -0
- data/spec/javascripts/support/jasmine_helper.rb +22 -0
- data/spec/javascripts/support/run.html.erb +23 -0
- data/spec/javascripts/views/AuditSpec.js +22 -0
- data/spec/javascripts/views/AuditSpec.ls +18 -0
- data/vendor/prelude-ls/.gitignore +2 -0
- data/vendor/prelude-ls/.travis.yml +3 -0
- data/vendor/prelude-ls/CHANGELOG.md +81 -0
- data/vendor/prelude-ls/LICENSE +22 -0
- data/vendor/prelude-ls/Makefile +50 -0
- data/vendor/prelude-ls/README.md +15 -0
- data/vendor/prelude-ls/browser/prelude-browser-min.js +1 -0
- data/vendor/prelude-ls/browser/prelude-browser.js +1172 -0
- data/vendor/prelude-ls/lib/Func.js +40 -0
- data/vendor/prelude-ls/lib/List.js +602 -0
- data/vendor/prelude-ls/lib/Num.js +129 -0
- data/vendor/prelude-ls/lib/Obj.js +153 -0
- data/vendor/prelude-ls/lib/Str.js +68 -0
- data/vendor/prelude-ls/lib/index.js +164 -0
- data/vendor/prelude-ls/package.json +50 -0
- data/vendor/prelude-ls/package.ls +46 -0
- data/vendor/prelude-ls/src/Func.ls +17 -0
- data/vendor/prelude-ls/src/List.ls +299 -0
- data/vendor/prelude-ls/src/Num.ls +83 -0
- data/vendor/prelude-ls/src/Obj.ls +61 -0
- data/vendor/prelude-ls/src/Str.ls +32 -0
- data/vendor/prelude-ls/src/index.ls +56 -0
- data/vendor/prelude-ls/test/Func.ls +36 -0
- data/vendor/prelude-ls/test/List.ls +751 -0
- data/vendor/prelude-ls/test/Num.ls +258 -0
- data/vendor/prelude-ls/test/Obj.ls +145 -0
- data/vendor/prelude-ls/test/Prelude.ls +49 -0
- data/vendor/prelude-ls/test/Str.ls +208 -0
- data/vendor/prelude-ls/test/browser.html +5 -0
- metadata +369 -0
@@ -0,0 +1,129 @@
|
|
1
|
+
var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm;
|
2
|
+
max = curry$(function(x$, y$){
|
3
|
+
return x$ > y$ ? x$ : y$;
|
4
|
+
});
|
5
|
+
min = curry$(function(x$, y$){
|
6
|
+
return x$ < y$ ? x$ : y$;
|
7
|
+
});
|
8
|
+
negate = function(x){
|
9
|
+
return -x;
|
10
|
+
};
|
11
|
+
abs = Math.abs;
|
12
|
+
signum = function(x){
|
13
|
+
if (x < 0) {
|
14
|
+
return -1;
|
15
|
+
} else if (x > 0) {
|
16
|
+
return 1;
|
17
|
+
} else {
|
18
|
+
return 0;
|
19
|
+
}
|
20
|
+
};
|
21
|
+
quot = curry$(function(x, y){
|
22
|
+
return ~~(x / y);
|
23
|
+
});
|
24
|
+
rem = curry$(function(x$, y$){
|
25
|
+
return x$ % y$;
|
26
|
+
});
|
27
|
+
div = curry$(function(x, y){
|
28
|
+
return Math.floor(x / y);
|
29
|
+
});
|
30
|
+
mod = curry$(function(x$, y$){
|
31
|
+
var ref$;
|
32
|
+
return ((x$) % (ref$ = y$) + ref$) % ref$;
|
33
|
+
});
|
34
|
+
recip = (function(it){
|
35
|
+
return 1 / it;
|
36
|
+
});
|
37
|
+
pi = Math.PI;
|
38
|
+
tau = pi * 2;
|
39
|
+
exp = Math.exp;
|
40
|
+
sqrt = Math.sqrt;
|
41
|
+
ln = Math.log;
|
42
|
+
pow = curry$(function(x$, y$){
|
43
|
+
return Math.pow(x$, y$);
|
44
|
+
});
|
45
|
+
sin = Math.sin;
|
46
|
+
tan = Math.tan;
|
47
|
+
cos = Math.cos;
|
48
|
+
asin = Math.asin;
|
49
|
+
acos = Math.acos;
|
50
|
+
atan = Math.atan;
|
51
|
+
atan2 = curry$(function(x, y){
|
52
|
+
return Math.atan2(x, y);
|
53
|
+
});
|
54
|
+
truncate = function(x){
|
55
|
+
return ~~x;
|
56
|
+
};
|
57
|
+
round = Math.round;
|
58
|
+
ceiling = Math.ceil;
|
59
|
+
floor = Math.floor;
|
60
|
+
isItNaN = function(x){
|
61
|
+
return x !== x;
|
62
|
+
};
|
63
|
+
even = function(x){
|
64
|
+
return x % 2 === 0;
|
65
|
+
};
|
66
|
+
odd = function(x){
|
67
|
+
return x % 2 !== 0;
|
68
|
+
};
|
69
|
+
gcd = curry$(function(x, y){
|
70
|
+
var z;
|
71
|
+
x = Math.abs(x);
|
72
|
+
y = Math.abs(y);
|
73
|
+
while (y !== 0) {
|
74
|
+
z = x % y;
|
75
|
+
x = y;
|
76
|
+
y = z;
|
77
|
+
}
|
78
|
+
return x;
|
79
|
+
});
|
80
|
+
lcm = curry$(function(x, y){
|
81
|
+
return Math.abs(Math.floor(x / gcd(x, y) * y));
|
82
|
+
});
|
83
|
+
module.exports = {
|
84
|
+
max: max,
|
85
|
+
min: min,
|
86
|
+
negate: negate,
|
87
|
+
abs: abs,
|
88
|
+
signum: signum,
|
89
|
+
quot: quot,
|
90
|
+
rem: rem,
|
91
|
+
div: div,
|
92
|
+
mod: mod,
|
93
|
+
recip: recip,
|
94
|
+
pi: pi,
|
95
|
+
tau: tau,
|
96
|
+
exp: exp,
|
97
|
+
sqrt: sqrt,
|
98
|
+
ln: ln,
|
99
|
+
pow: pow,
|
100
|
+
sin: sin,
|
101
|
+
tan: tan,
|
102
|
+
cos: cos,
|
103
|
+
acos: acos,
|
104
|
+
asin: asin,
|
105
|
+
atan: atan,
|
106
|
+
atan2: atan2,
|
107
|
+
truncate: truncate,
|
108
|
+
round: round,
|
109
|
+
ceiling: ceiling,
|
110
|
+
floor: floor,
|
111
|
+
isItNaN: isItNaN,
|
112
|
+
even: even,
|
113
|
+
odd: odd,
|
114
|
+
gcd: gcd,
|
115
|
+
lcm: lcm
|
116
|
+
};
|
117
|
+
function curry$(f, bound){
|
118
|
+
var context,
|
119
|
+
_curry = function(args) {
|
120
|
+
return f.length > 1 ? function(){
|
121
|
+
var params = args ? args.concat() : [];
|
122
|
+
context = bound ? context || this : this;
|
123
|
+
return params.push.apply(params, arguments) <
|
124
|
+
f.length && arguments.length ?
|
125
|
+
_curry.call(context, params) : f.apply(context, params);
|
126
|
+
} : f;
|
127
|
+
};
|
128
|
+
return _curry();
|
129
|
+
}
|
@@ -0,0 +1,153 @@
|
|
1
|
+
var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find;
|
2
|
+
values = function(object){
|
3
|
+
var i$, x, results$ = [];
|
4
|
+
for (i$ in object) {
|
5
|
+
x = object[i$];
|
6
|
+
results$.push(x);
|
7
|
+
}
|
8
|
+
return results$;
|
9
|
+
};
|
10
|
+
keys = function(object){
|
11
|
+
var x, results$ = [];
|
12
|
+
for (x in object) {
|
13
|
+
results$.push(x);
|
14
|
+
}
|
15
|
+
return results$;
|
16
|
+
};
|
17
|
+
pairsToObj = function(object){
|
18
|
+
var i$, len$, x, results$ = {};
|
19
|
+
for (i$ = 0, len$ = object.length; i$ < len$; ++i$) {
|
20
|
+
x = object[i$];
|
21
|
+
results$[x[0]] = x[1];
|
22
|
+
}
|
23
|
+
return results$;
|
24
|
+
};
|
25
|
+
objToPairs = function(object){
|
26
|
+
var key, value, results$ = [];
|
27
|
+
for (key in object) {
|
28
|
+
value = object[key];
|
29
|
+
results$.push([key, value]);
|
30
|
+
}
|
31
|
+
return results$;
|
32
|
+
};
|
33
|
+
listsToObj = curry$(function(keys, values){
|
34
|
+
var i$, len$, i, key, results$ = {};
|
35
|
+
for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) {
|
36
|
+
i = i$;
|
37
|
+
key = keys[i$];
|
38
|
+
results$[key] = values[i];
|
39
|
+
}
|
40
|
+
return results$;
|
41
|
+
});
|
42
|
+
objToLists = function(objectect){
|
43
|
+
var keys, values, key, value;
|
44
|
+
keys = [];
|
45
|
+
values = [];
|
46
|
+
for (key in objectect) {
|
47
|
+
value = objectect[key];
|
48
|
+
keys.push(key);
|
49
|
+
values.push(value);
|
50
|
+
}
|
51
|
+
return [keys, values];
|
52
|
+
};
|
53
|
+
empty = function(object){
|
54
|
+
var x;
|
55
|
+
for (x in object) {
|
56
|
+
return false;
|
57
|
+
}
|
58
|
+
return true;
|
59
|
+
};
|
60
|
+
each = curry$(function(f, object){
|
61
|
+
var i$, x;
|
62
|
+
for (i$ in object) {
|
63
|
+
x = object[i$];
|
64
|
+
f(x);
|
65
|
+
}
|
66
|
+
return object;
|
67
|
+
});
|
68
|
+
map = curry$(function(f, object){
|
69
|
+
var k, x, results$ = {};
|
70
|
+
for (k in object) {
|
71
|
+
x = object[k];
|
72
|
+
results$[k] = f(x);
|
73
|
+
}
|
74
|
+
return results$;
|
75
|
+
});
|
76
|
+
compact = curry$(function(object){
|
77
|
+
var k, x, results$ = {};
|
78
|
+
for (k in object) {
|
79
|
+
x = object[k];
|
80
|
+
if (x) {
|
81
|
+
results$[k] = x;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
return results$;
|
85
|
+
});
|
86
|
+
filter = curry$(function(f, object){
|
87
|
+
var k, x, results$ = {};
|
88
|
+
for (k in object) {
|
89
|
+
x = object[k];
|
90
|
+
if (f(x)) {
|
91
|
+
results$[k] = x;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
return results$;
|
95
|
+
});
|
96
|
+
reject = curry$(function(f, object){
|
97
|
+
var k, x, results$ = {};
|
98
|
+
for (k in object) {
|
99
|
+
x = object[k];
|
100
|
+
if (!f(x)) {
|
101
|
+
results$[k] = x;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
return results$;
|
105
|
+
});
|
106
|
+
partition = curry$(function(f, object){
|
107
|
+
var passed, failed, k, x;
|
108
|
+
passed = {};
|
109
|
+
failed = {};
|
110
|
+
for (k in object) {
|
111
|
+
x = object[k];
|
112
|
+
(f(x) ? passed : failed)[k] = x;
|
113
|
+
}
|
114
|
+
return [passed, failed];
|
115
|
+
});
|
116
|
+
find = curry$(function(f, object){
|
117
|
+
var i$, x;
|
118
|
+
for (i$ in object) {
|
119
|
+
x = object[i$];
|
120
|
+
if (f(x)) {
|
121
|
+
return x;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
});
|
125
|
+
module.exports = {
|
126
|
+
values: values,
|
127
|
+
keys: keys,
|
128
|
+
pairsToObj: pairsToObj,
|
129
|
+
objToPairs: objToPairs,
|
130
|
+
listsToObj: listsToObj,
|
131
|
+
objToLists: objToLists,
|
132
|
+
empty: empty,
|
133
|
+
each: each,
|
134
|
+
map: map,
|
135
|
+
filter: filter,
|
136
|
+
compact: compact,
|
137
|
+
reject: reject,
|
138
|
+
partition: partition,
|
139
|
+
find: find
|
140
|
+
};
|
141
|
+
function curry$(f, bound){
|
142
|
+
var context,
|
143
|
+
_curry = function(args) {
|
144
|
+
return f.length > 1 ? function(){
|
145
|
+
var params = args ? args.concat() : [];
|
146
|
+
context = bound ? context || this : this;
|
147
|
+
return params.push.apply(params, arguments) <
|
148
|
+
f.length && arguments.length ?
|
149
|
+
_curry.call(context, params) : f.apply(context, params);
|
150
|
+
} : f;
|
151
|
+
};
|
152
|
+
return _curry();
|
153
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat;
|
2
|
+
split = curry$(function(sep, str){
|
3
|
+
return str.split(sep);
|
4
|
+
});
|
5
|
+
join = curry$(function(sep, xs){
|
6
|
+
return xs.join(sep);
|
7
|
+
});
|
8
|
+
lines = function(str){
|
9
|
+
if (!str.length) {
|
10
|
+
return [];
|
11
|
+
}
|
12
|
+
return str.split('\n');
|
13
|
+
};
|
14
|
+
unlines = function(it){
|
15
|
+
return it.join('\n');
|
16
|
+
};
|
17
|
+
words = function(str){
|
18
|
+
if (!str.length) {
|
19
|
+
return [];
|
20
|
+
}
|
21
|
+
return str.split(/[ ]+/);
|
22
|
+
};
|
23
|
+
unwords = function(it){
|
24
|
+
return it.join(' ');
|
25
|
+
};
|
26
|
+
chars = function(it){
|
27
|
+
return it.split('');
|
28
|
+
};
|
29
|
+
unchars = function(it){
|
30
|
+
return it.join('');
|
31
|
+
};
|
32
|
+
reverse = function(str){
|
33
|
+
return str.split('').reverse().join('');
|
34
|
+
};
|
35
|
+
repeat = curry$(function(n, str){
|
36
|
+
var out, res$, i$;
|
37
|
+
res$ = [];
|
38
|
+
for (i$ = 0; i$ < n; ++i$) {
|
39
|
+
res$.push(str);
|
40
|
+
}
|
41
|
+
out = res$;
|
42
|
+
return out.join('');
|
43
|
+
});
|
44
|
+
module.exports = {
|
45
|
+
split: split,
|
46
|
+
join: join,
|
47
|
+
lines: lines,
|
48
|
+
unlines: unlines,
|
49
|
+
words: words,
|
50
|
+
unwords: unwords,
|
51
|
+
chars: chars,
|
52
|
+
unchars: unchars,
|
53
|
+
reverse: reverse,
|
54
|
+
repeat: repeat
|
55
|
+
};
|
56
|
+
function curry$(f, bound){
|
57
|
+
var context,
|
58
|
+
_curry = function(args) {
|
59
|
+
return f.length > 1 ? function(){
|
60
|
+
var params = args ? args.concat() : [];
|
61
|
+
context = bound ? context || this : this;
|
62
|
+
return params.push.apply(params, arguments) <
|
63
|
+
f.length && arguments.length ?
|
64
|
+
_curry.call(context, params) : f.apply(context, params);
|
65
|
+
} : f;
|
66
|
+
};
|
67
|
+
return _curry();
|
68
|
+
}
|
@@ -0,0 +1,164 @@
|
|
1
|
+
var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
|
2
|
+
Func = require('./Func.js');
|
3
|
+
List = require('./List.js');
|
4
|
+
Obj = require('./Obj.js');
|
5
|
+
Str = require('./Str.js');
|
6
|
+
Num = require('./Num.js');
|
7
|
+
id = function(x){
|
8
|
+
return x;
|
9
|
+
};
|
10
|
+
isType = curry$(function(type, x){
|
11
|
+
return toString$.call(x).slice(8, -1) === type;
|
12
|
+
});
|
13
|
+
replicate = curry$(function(n, x){
|
14
|
+
var i$, results$ = [];
|
15
|
+
for (i$ = 0; i$ < n; ++i$) {
|
16
|
+
results$.push(x);
|
17
|
+
}
|
18
|
+
return results$;
|
19
|
+
});
|
20
|
+
Str.empty = List.empty;
|
21
|
+
Str.slice = List.slice;
|
22
|
+
Str.take = List.take;
|
23
|
+
Str.drop = List.drop;
|
24
|
+
Str.splitAt = List.splitAt;
|
25
|
+
Str.takeWhile = List.takeWhile;
|
26
|
+
Str.dropWhile = List.dropWhile;
|
27
|
+
Str.span = List.span;
|
28
|
+
Str.breakStr = List.breakList;
|
29
|
+
prelude = {
|
30
|
+
Func: Func,
|
31
|
+
List: List,
|
32
|
+
Obj: Obj,
|
33
|
+
Str: Str,
|
34
|
+
Num: Num,
|
35
|
+
id: id,
|
36
|
+
isType: isType,
|
37
|
+
replicate: replicate
|
38
|
+
};
|
39
|
+
prelude.each = List.each;
|
40
|
+
prelude.map = List.map;
|
41
|
+
prelude.filter = List.filter;
|
42
|
+
prelude.compact = List.compact;
|
43
|
+
prelude.reject = List.reject;
|
44
|
+
prelude.partition = List.partition;
|
45
|
+
prelude.find = List.find;
|
46
|
+
prelude.head = List.head;
|
47
|
+
prelude.first = List.first;
|
48
|
+
prelude.tail = List.tail;
|
49
|
+
prelude.last = List.last;
|
50
|
+
prelude.initial = List.initial;
|
51
|
+
prelude.empty = List.empty;
|
52
|
+
prelude.reverse = List.reverse;
|
53
|
+
prelude.difference = List.difference;
|
54
|
+
prelude.intersection = List.intersection;
|
55
|
+
prelude.union = List.union;
|
56
|
+
prelude.countBy = List.countBy;
|
57
|
+
prelude.groupBy = List.groupBy;
|
58
|
+
prelude.fold = List.fold;
|
59
|
+
prelude.foldl = List.foldl;
|
60
|
+
prelude.fold1 = List.fold1;
|
61
|
+
prelude.foldl1 = List.foldl1;
|
62
|
+
prelude.foldr = List.foldr;
|
63
|
+
prelude.foldr1 = List.foldr1;
|
64
|
+
prelude.unfoldr = List.unfoldr;
|
65
|
+
prelude.andList = List.andList;
|
66
|
+
prelude.orList = List.orList;
|
67
|
+
prelude.any = List.any;
|
68
|
+
prelude.all = List.all;
|
69
|
+
prelude.unique = List.unique;
|
70
|
+
prelude.sort = List.sort;
|
71
|
+
prelude.sortWith = List.sortWith;
|
72
|
+
prelude.sortBy = List.sortBy;
|
73
|
+
prelude.sum = List.sum;
|
74
|
+
prelude.product = List.product;
|
75
|
+
prelude.mean = List.mean;
|
76
|
+
prelude.average = List.average;
|
77
|
+
prelude.concat = List.concat;
|
78
|
+
prelude.concatMap = List.concatMap;
|
79
|
+
prelude.flatten = List.flatten;
|
80
|
+
prelude.maximum = List.maximum;
|
81
|
+
prelude.minimum = List.minimum;
|
82
|
+
prelude.scan = List.scan;
|
83
|
+
prelude.scanl = List.scanl;
|
84
|
+
prelude.scan1 = List.scan1;
|
85
|
+
prelude.scanl1 = List.scanl1;
|
86
|
+
prelude.scanr = List.scanr;
|
87
|
+
prelude.scanr1 = List.scanr1;
|
88
|
+
prelude.slice = List.slice;
|
89
|
+
prelude.take = List.take;
|
90
|
+
prelude.drop = List.drop;
|
91
|
+
prelude.splitAt = List.splitAt;
|
92
|
+
prelude.takeWhile = List.takeWhile;
|
93
|
+
prelude.dropWhile = List.dropWhile;
|
94
|
+
prelude.span = List.span;
|
95
|
+
prelude.breakList = List.breakList;
|
96
|
+
prelude.zip = List.zip;
|
97
|
+
prelude.zipWith = List.zipWith;
|
98
|
+
prelude.zipAll = List.zipAll;
|
99
|
+
prelude.zipAllWith = List.zipAllWith;
|
100
|
+
prelude.apply = Func.apply;
|
101
|
+
prelude.curry = Func.curry;
|
102
|
+
prelude.flip = Func.flip;
|
103
|
+
prelude.fix = Func.fix;
|
104
|
+
prelude.split = Str.split;
|
105
|
+
prelude.join = Str.join;
|
106
|
+
prelude.lines = Str.lines;
|
107
|
+
prelude.unlines = Str.unlines;
|
108
|
+
prelude.words = Str.words;
|
109
|
+
prelude.unwords = Str.unwords;
|
110
|
+
prelude.chars = Str.chars;
|
111
|
+
prelude.unchars = Str.unchars;
|
112
|
+
prelude.values = Obj.values;
|
113
|
+
prelude.keys = Obj.keys;
|
114
|
+
prelude.pairsToObj = Obj.pairsToObj;
|
115
|
+
prelude.objToPairs = Obj.objToPairs;
|
116
|
+
prelude.listsToObj = Obj.listsToObj;
|
117
|
+
prelude.objToLists = Obj.objToLists;
|
118
|
+
prelude.max = Num.max;
|
119
|
+
prelude.min = Num.min;
|
120
|
+
prelude.negate = Num.negate;
|
121
|
+
prelude.abs = Num.abs;
|
122
|
+
prelude.signum = Num.signum;
|
123
|
+
prelude.quot = Num.quot;
|
124
|
+
prelude.rem = Num.rem;
|
125
|
+
prelude.div = Num.div;
|
126
|
+
prelude.mod = Num.mod;
|
127
|
+
prelude.recip = Num.recip;
|
128
|
+
prelude.pi = Num.pi;
|
129
|
+
prelude.tau = Num.tau;
|
130
|
+
prelude.exp = Num.exp;
|
131
|
+
prelude.sqrt = Num.sqrt;
|
132
|
+
prelude.ln = Num.ln;
|
133
|
+
prelude.pow = Num.pow;
|
134
|
+
prelude.sin = Num.sin;
|
135
|
+
prelude.tan = Num.tan;
|
136
|
+
prelude.cos = Num.cos;
|
137
|
+
prelude.acos = Num.acos;
|
138
|
+
prelude.asin = Num.asin;
|
139
|
+
prelude.atan = Num.atan;
|
140
|
+
prelude.atan2 = Num.atan2;
|
141
|
+
prelude.truncate = Num.truncate;
|
142
|
+
prelude.round = Num.round;
|
143
|
+
prelude.ceiling = Num.ceiling;
|
144
|
+
prelude.floor = Num.floor;
|
145
|
+
prelude.isItNaN = Num.isItNaN;
|
146
|
+
prelude.even = Num.even;
|
147
|
+
prelude.odd = Num.odd;
|
148
|
+
prelude.gcd = Num.gcd;
|
149
|
+
prelude.lcm = Num.lcm;
|
150
|
+
prelude.VERSION = '1.0.3';
|
151
|
+
module.exports = prelude;
|
152
|
+
function curry$(f, bound){
|
153
|
+
var context,
|
154
|
+
_curry = function(args) {
|
155
|
+
return f.length > 1 ? function(){
|
156
|
+
var params = args ? args.concat() : [];
|
157
|
+
context = bound ? context || this : this;
|
158
|
+
return params.push.apply(params, arguments) <
|
159
|
+
f.length && arguments.length ?
|
160
|
+
_curry.call(context, params) : f.apply(context, params);
|
161
|
+
} : f;
|
162
|
+
};
|
163
|
+
return _curry();
|
164
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
{
|
2
|
+
"name": "prelude-ls",
|
3
|
+
"version": "1.0.3",
|
4
|
+
"author": "George Zahariev <z@georgezahariev.com>",
|
5
|
+
"description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.",
|
6
|
+
"keywords": [
|
7
|
+
"prelude",
|
8
|
+
"livescript",
|
9
|
+
"utility",
|
10
|
+
"ls",
|
11
|
+
"coffeescript",
|
12
|
+
"javascript",
|
13
|
+
"library",
|
14
|
+
"functional",
|
15
|
+
"array",
|
16
|
+
"list",
|
17
|
+
"object",
|
18
|
+
"string"
|
19
|
+
],
|
20
|
+
"main": "lib/",
|
21
|
+
"files": [
|
22
|
+
"lib/",
|
23
|
+
"README.md",
|
24
|
+
"LICENSE"
|
25
|
+
],
|
26
|
+
"homepage": "http://preludels.com",
|
27
|
+
"bugs": "https://github.com/gkz/prelude-ls/issues",
|
28
|
+
"licenses": [
|
29
|
+
{
|
30
|
+
"type": "MIT",
|
31
|
+
"url": "https://raw.github.com/gkz/prelude-ls/master/LICENSE"
|
32
|
+
}
|
33
|
+
],
|
34
|
+
"engines": {
|
35
|
+
"node": ">= 0.8.0"
|
36
|
+
},
|
37
|
+
"repository": {
|
38
|
+
"type": "git",
|
39
|
+
"url": "git://github.com/gkz/prelude-ls.git"
|
40
|
+
},
|
41
|
+
"scripts": {
|
42
|
+
"test": "make test"
|
43
|
+
},
|
44
|
+
"devDependencies": {
|
45
|
+
"LiveScript": "~1.1.1",
|
46
|
+
"uglify-js": "~2.2.5",
|
47
|
+
"mocha": "~1.8.2",
|
48
|
+
"browserify": "~2.13.2"
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
name: 'prelude-ls'
|
2
|
+
version: '1.0.3'
|
3
|
+
|
4
|
+
author: 'George Zahariev <z@georgezahariev.com>'
|
5
|
+
|
6
|
+
description: "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript."
|
7
|
+
|
8
|
+
keywords:
|
9
|
+
'prelude'
|
10
|
+
'livescript'
|
11
|
+
'utility'
|
12
|
+
'ls'
|
13
|
+
'coffeescript'
|
14
|
+
'javascript'
|
15
|
+
'library'
|
16
|
+
'functional'
|
17
|
+
'array'
|
18
|
+
'list'
|
19
|
+
'object'
|
20
|
+
'string'
|
21
|
+
|
22
|
+
main: 'lib/'
|
23
|
+
files:
|
24
|
+
'lib/'
|
25
|
+
'README.md'
|
26
|
+
'LICENSE'
|
27
|
+
|
28
|
+
homepage: 'http://preludels.com'
|
29
|
+
bugs: 'https://github.com/gkz/prelude-ls/issues'
|
30
|
+
licenses:
|
31
|
+
* type: 'MIT'
|
32
|
+
url: 'https://raw.github.com/gkz/prelude-ls/master/LICENSE'
|
33
|
+
...
|
34
|
+
engines:
|
35
|
+
node: '>= 0.8.0'
|
36
|
+
repository:
|
37
|
+
type: 'git'
|
38
|
+
url: 'git://github.com/gkz/prelude-ls.git'
|
39
|
+
scripts:
|
40
|
+
test: "make test"
|
41
|
+
|
42
|
+
dev-dependencies:
|
43
|
+
LiveScript: '~1.1.1'
|
44
|
+
'uglify-js': '~2.2.5'
|
45
|
+
mocha: '~1.8.2'
|
46
|
+
browserify: '~2.13.2'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
curry = (f) ->
|
2
|
+
curry$ f # using util method curry$ from livescript
|
3
|
+
|
4
|
+
flip = (f, x, y) --> f y, x
|
5
|
+
|
6
|
+
fix = (f) ->
|
7
|
+
( (g, x) -> -> f(g g) ...arguments ) do
|
8
|
+
(g, x) -> -> f(g g) ...arguments
|
9
|
+
|
10
|
+
apply = (f, list) -->
|
11
|
+
f.apply null, list
|
12
|
+
|
13
|
+
#? memoize, wrap
|
14
|
+
|
15
|
+
module.exports = {
|
16
|
+
curry, flip, fix, apply
|
17
|
+
}
|