conjur-asset-ui-api 1.1.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/Gemfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +41 -0
- data/Rakefile +1 -0
- data/compile_ls +2 -0
- data/conjur-asset-ui.gemspec +36 -0
- data/lib/conjur-asset-ui-version.rb +7 -0
- data/lib/conjur-asset-ui.rb +7 -0
- data/lib/conjur/audit/follower.rb +63 -0
- data/lib/conjur/audit/humanizer.rb +53 -0
- data/lib/conjur/audit/tableizer.rb +55 -0
- data/lib/conjur/command/ui.rb +38 -0
- data/lib/conjur/webserver/api_proxy.rb +94 -0
- data/lib/conjur/webserver/audit_stream.rb +92 -0
- data/lib/conjur/webserver/authorize.rb +28 -0
- data/lib/conjur/webserver/conjur_info.rb +33 -0
- data/lib/conjur/webserver/home.rb +36 -0
- data/lib/conjur/webserver/login.rb +50 -0
- data/lib/conjur/webserver/server.rb +111 -0
- data/livescript/views/audit.ls +124 -0
- data/public/css/bootstrap.css +7 -0
- data/public/css/styles.less +400 -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-service-dots.svg +13 -0
- data/public/images/icon-variable.png +0 -0
- data/public/index.html +121 -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-with-addons.js +15505 -0
- data/public/js/lib/react.js +14469 -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 +353 -0
- data/public/js/models/namespace.js +6 -0
- data/public/js/models/policyList.js +10 -0
- data/public/js/models/record.js +26 -0
- data/public/js/models/resourceList.js +61 -0
- data/public/js/models/userList.js +16 -0
- data/public/js/models/variableList.js +12 -0
- data/public/js/views/audit.js +191 -0
- data/public/js/views/dashboard.js +35 -0
- data/public/js/views/generic.js +42 -0
- data/public/js/views/group.js +32 -0
- data/public/js/views/groups.js +18 -0
- data/public/js/views/host.js +40 -0
- data/public/js/views/hosts.js +18 -0
- data/public/js/views/layer.js +63 -0
- data/public/js/views/layers.js +18 -0
- data/public/js/views/mixins/search.js +9 -0
- data/public/js/views/namespaces.js +40 -0
- data/public/js/views/navSearch.js +16 -0
- data/public/js/views/permissions.js +91 -0
- data/public/js/views/policies.js +17 -0
- data/public/js/views/policy.js +23 -0
- data/public/js/views/resource.js +23 -0
- data/public/js/views/role.js +18 -0
- data/public/js/views/searchResults.js +146 -0
- data/public/js/views/time.js +14 -0
- data/public/js/views/user.js +22 -0
- data/public/js/views/users.js +18 -0
- data/public/js/views/variable.js +41 -0
- data/public/js/views/variables.js +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 +328 -0
@@ -0,0 +1,258 @@
|
|
1
|
+
{
|
2
|
+
max, min, negate, abs, signum, quot, rem, div, mod, recip,
|
3
|
+
pi, tau, exp, sqrt, ln, pow, sin, tan, cos, acos, asin, atan, atan2,
|
4
|
+
truncate, round, ceiling, floor, is-it-NaN, even, odd, gcd, lcm,
|
5
|
+
} = require '..'
|
6
|
+
{equal: eq, deep-equal: deep-eq, ok} = require 'assert'
|
7
|
+
|
8
|
+
suite 'max' ->
|
9
|
+
test 'numbers' ->
|
10
|
+
eq 3, max 3 3
|
11
|
+
eq 3, max 2 3
|
12
|
+
eq 3, max 3 2
|
13
|
+
|
14
|
+
test 'characters' ->
|
15
|
+
eq \b, max \a \b
|
16
|
+
|
17
|
+
test 'curried' ->
|
18
|
+
f = max 2
|
19
|
+
eq 3, f 3
|
20
|
+
|
21
|
+
suite 'min' ->
|
22
|
+
test 'numbers' ->
|
23
|
+
eq 0, min 9 0
|
24
|
+
|
25
|
+
test 'characters' ->
|
26
|
+
eq \a, min \a \b
|
27
|
+
|
28
|
+
test 'curried' ->
|
29
|
+
f = min 9
|
30
|
+
eq 0, f 0
|
31
|
+
|
32
|
+
suite 'negate' ->
|
33
|
+
test 'zero' ->
|
34
|
+
eq 0, negate 0
|
35
|
+
|
36
|
+
test 'negative number' ->
|
37
|
+
eq -2, negate 2
|
38
|
+
|
39
|
+
test 'positive number' ->
|
40
|
+
eq 3, negate -3
|
41
|
+
|
42
|
+
suite 'abs' ->
|
43
|
+
test 'zero' ->
|
44
|
+
eq 0, abs 0
|
45
|
+
|
46
|
+
test 'negative number' ->
|
47
|
+
eq 4 abs -4
|
48
|
+
|
49
|
+
test 'positive number' ->
|
50
|
+
eq 4 abs 4
|
51
|
+
|
52
|
+
suite 'signum' ->
|
53
|
+
test 'zero' ->
|
54
|
+
eq 0 signum 0
|
55
|
+
|
56
|
+
test 'negative number' ->
|
57
|
+
eq -1 signum -5.3
|
58
|
+
|
59
|
+
test 'positive number' ->
|
60
|
+
eq 1 signum 8
|
61
|
+
|
62
|
+
suite 'quot' ->
|
63
|
+
test 'simple' ->
|
64
|
+
eq -6, quot -20 3
|
65
|
+
|
66
|
+
test 'curried' ->
|
67
|
+
f = quot -20
|
68
|
+
eq -6, f 3
|
69
|
+
|
70
|
+
suite 'rem' ->
|
71
|
+
test 'simple' ->
|
72
|
+
eq -2, rem -20 3
|
73
|
+
|
74
|
+
test 'curried' ->
|
75
|
+
f = rem -20
|
76
|
+
eq -2, f 3
|
77
|
+
|
78
|
+
suite 'div' ->
|
79
|
+
test 'simple' ->
|
80
|
+
eq -7, div -20 3
|
81
|
+
|
82
|
+
test 'curried' ->
|
83
|
+
f = div -20
|
84
|
+
eq -7, f 3
|
85
|
+
|
86
|
+
suite 'mod' ->
|
87
|
+
test 'simple' ->
|
88
|
+
eq 1, mod -20 3
|
89
|
+
|
90
|
+
test 'curried' ->
|
91
|
+
f = mod -20
|
92
|
+
eq 1, f 3
|
93
|
+
|
94
|
+
suite 'recip' ->
|
95
|
+
test 'zero' ->
|
96
|
+
eq Infinity, recip 0
|
97
|
+
|
98
|
+
test 'larger than 1' ->
|
99
|
+
eq 0.5, recip 2
|
100
|
+
|
101
|
+
test 'between 0 and 1' ->
|
102
|
+
eq 2, recip 0.5
|
103
|
+
|
104
|
+
suite 'pi' ->
|
105
|
+
test 'constant' ->
|
106
|
+
eq 3.141592653589793, pi
|
107
|
+
|
108
|
+
suite 'tau' ->
|
109
|
+
test 'constant' ->
|
110
|
+
eq 6.283185307179586, tau
|
111
|
+
|
112
|
+
suite 'exp' ->
|
113
|
+
test 'simple' ->
|
114
|
+
eq 2.718281828459045, exp 1
|
115
|
+
|
116
|
+
suite 'sqrt' ->
|
117
|
+
test 'negative numbers' ->
|
118
|
+
ok is-it-NaN sqrt -1
|
119
|
+
|
120
|
+
test 'simple' ->
|
121
|
+
eq 2 sqrt 4
|
122
|
+
|
123
|
+
suite 'ln' ->
|
124
|
+
test 'simple' ->
|
125
|
+
eq 0.6931471805599453, ln 2
|
126
|
+
|
127
|
+
suite 'pow' ->
|
128
|
+
test 'simple' ->
|
129
|
+
eq 4, pow 2 2
|
130
|
+
eq 4, pow -2 2
|
131
|
+
|
132
|
+
test 'with negative numbers' ->
|
133
|
+
eq 0.25, pow 2 -2
|
134
|
+
|
135
|
+
test 'between one and zero' ->
|
136
|
+
eq 4, pow 16 0.5
|
137
|
+
|
138
|
+
test 'curried' ->
|
139
|
+
f = pow 2
|
140
|
+
eq 4, f 2
|
141
|
+
|
142
|
+
suite 'sin' ->
|
143
|
+
test 'zero' ->
|
144
|
+
eq 0, sin 0
|
145
|
+
|
146
|
+
test 'one' ->
|
147
|
+
eq 0.8414709848078965, sin 1
|
148
|
+
|
149
|
+
suite 'tan' ->
|
150
|
+
test 'zero' ->
|
151
|
+
eq 0, tan 0
|
152
|
+
|
153
|
+
test 'one' ->
|
154
|
+
eq 1.5574077246549023, tan 1
|
155
|
+
|
156
|
+
suite 'cos' ->
|
157
|
+
test 'zero' ->
|
158
|
+
eq 1, cos 0
|
159
|
+
|
160
|
+
test 'one' ->
|
161
|
+
eq 0.5403023058681398, cos 1
|
162
|
+
|
163
|
+
suite 'acos' ->
|
164
|
+
test 'number' ->
|
165
|
+
eq 1.4706289056333368, acos 0.1
|
166
|
+
|
167
|
+
suite 'asin' ->
|
168
|
+
test 'number' ->
|
169
|
+
eq 1.5707963267948966, asin 1
|
170
|
+
|
171
|
+
suite 'atan' ->
|
172
|
+
test 'number' ->
|
173
|
+
eq 0.7853981633974483, atan 1
|
174
|
+
|
175
|
+
suite 'atan2' ->
|
176
|
+
test 'number' ->
|
177
|
+
eq 0.4636476090008061, atan2 1 2
|
178
|
+
|
179
|
+
test 'curried' ->
|
180
|
+
f = atan2 1
|
181
|
+
eq 0.4636476090008061, f 2
|
182
|
+
|
183
|
+
suite 'truncate' ->
|
184
|
+
test 'zero' ->
|
185
|
+
eq 0, truncate 0
|
186
|
+
|
187
|
+
test 'positive number' ->
|
188
|
+
eq 1 truncate 1.5
|
189
|
+
|
190
|
+
test 'negative number' ->
|
191
|
+
eq -1 truncate -1.5
|
192
|
+
|
193
|
+
suite 'round' ->
|
194
|
+
test 'up' ->
|
195
|
+
eq 1 round 0.6
|
196
|
+
eq 1 round 0.5
|
197
|
+
|
198
|
+
test 'down' ->
|
199
|
+
eq 0 round 0.4
|
200
|
+
|
201
|
+
suite 'ceiling' ->
|
202
|
+
test 'zero' ->
|
203
|
+
eq 0, ceiling 0
|
204
|
+
|
205
|
+
test 'positive number' ->
|
206
|
+
eq 1, ceiling 0.1
|
207
|
+
|
208
|
+
test 'negative number' ->
|
209
|
+
eq 0, ceiling -0.9
|
210
|
+
|
211
|
+
suite 'floor' ->
|
212
|
+
test 'zero' ->
|
213
|
+
eq 0, floor 0
|
214
|
+
|
215
|
+
test 'positive number' ->
|
216
|
+
eq 0, floor 0.9
|
217
|
+
|
218
|
+
test 'negative number' ->
|
219
|
+
eq -1, floor -0.1
|
220
|
+
|
221
|
+
suite 'is-it-NaN' ->
|
222
|
+
test 'true' ->
|
223
|
+
ok is-it-NaN Math.sqrt -1
|
224
|
+
|
225
|
+
test 'false' ->
|
226
|
+
ok not is-it-NaN '0'
|
227
|
+
|
228
|
+
suite 'even' ->
|
229
|
+
test 'true' ->
|
230
|
+
ok even 0
|
231
|
+
ok even -2
|
232
|
+
|
233
|
+
test 'false' ->
|
234
|
+
ok not even 7
|
235
|
+
|
236
|
+
suite 'odd' ->
|
237
|
+
test 'true' ->
|
238
|
+
ok odd 3
|
239
|
+
|
240
|
+
test 'false' ->
|
241
|
+
ok not odd -4
|
242
|
+
ok not odd 0
|
243
|
+
|
244
|
+
suite 'gcd' ->
|
245
|
+
test 'some numbers' ->
|
246
|
+
eq 6, gcd 12 18
|
247
|
+
|
248
|
+
test 'curried' ->
|
249
|
+
f = gcd 12
|
250
|
+
eq 6, f 18
|
251
|
+
|
252
|
+
suite 'lcm' ->
|
253
|
+
test 'some numbers' ->
|
254
|
+
eq 36, lcm 12 18
|
255
|
+
|
256
|
+
test 'curried' ->
|
257
|
+
f = lcm 12
|
258
|
+
eq 36, f 18
|
@@ -0,0 +1,145 @@
|
|
1
|
+
{
|
2
|
+
id
|
3
|
+
Obj: {
|
4
|
+
values, keys,
|
5
|
+
pairs-to-obj, obj-to-pairs, lists-to-obj, obj-to-lists,
|
6
|
+
empty, each, map, filter, compact, reject, partition, find,
|
7
|
+
}
|
8
|
+
} = require '..'
|
9
|
+
{equal: eq, deep-equal: deep-eq, ok} = require 'assert'
|
10
|
+
|
11
|
+
suite 'values' ->
|
12
|
+
test 'empty object as input' ->
|
13
|
+
deep-eq [], values {}
|
14
|
+
|
15
|
+
test 'object as input' ->
|
16
|
+
deep-eq [1 2 3], values sadf: 1, asdf: 2, fdas: 3
|
17
|
+
|
18
|
+
suite 'keys' ->
|
19
|
+
test 'empty object as input' ->
|
20
|
+
deep-eq [], keys {}
|
21
|
+
|
22
|
+
test 'object as input' ->
|
23
|
+
deep-eq <[ sadf asdf fdas ]>, keys sadf: 1, asdf: 2, fdas: 3
|
24
|
+
|
25
|
+
suite 'pairs-to-obj' ->
|
26
|
+
test 'empty list as input' ->
|
27
|
+
deep-eq {}, pairs-to-obj []
|
28
|
+
|
29
|
+
test 'pairs as input' ->
|
30
|
+
deep-eq {a: 'b', c: 'd', e: 1}, pairs-to-obj [['a' 'b'] ['c' 'd'] ['e' 1]]
|
31
|
+
|
32
|
+
suite 'obj-to-pairs' ->
|
33
|
+
test 'empty object as input' ->
|
34
|
+
deep-eq [], obj-to-pairs {}
|
35
|
+
|
36
|
+
test 'object as input' ->
|
37
|
+
deep-eq [['a' 'b'] ['c' 'd'] ['e' 1]], obj-to-pairs {a: 'b', c: 'd', e: 1}
|
38
|
+
|
39
|
+
suite 'lists-to-obj' ->
|
40
|
+
test 'empty lists as input' ->
|
41
|
+
deep-eq {}, lists-to-obj [] []
|
42
|
+
|
43
|
+
test 'two lists of the same length' ->
|
44
|
+
deep-eq {a: 1, b: 2, c: 3}, lists-to-obj <[ a b c ]> [1 2 3]
|
45
|
+
|
46
|
+
test 'first list is shorter' ->
|
47
|
+
deep-eq {a: 1, b: 2}, lists-to-obj <[ a b ]> [1 2 3]
|
48
|
+
|
49
|
+
test 'first list is longer' ->
|
50
|
+
deep-eq {a: 1, b: 2, c: void}, lists-to-obj <[ a b c ]> [1 2]
|
51
|
+
|
52
|
+
test 'curried' ->
|
53
|
+
f = lists-to-obj <[ a b c ]>
|
54
|
+
deep-eq {a: 1, b: 2, c: 3}, f [1 2 3]
|
55
|
+
|
56
|
+
suite 'obj-to-lists' ->
|
57
|
+
test 'empty object as input' ->
|
58
|
+
deep-eq [[], []], obj-to-lists {}
|
59
|
+
|
60
|
+
test 'two lists of the same length' ->
|
61
|
+
deep-eq [<[ a b c ]>, [1 2 3]], obj-to-lists {a: 1, b: 2, c: 3}
|
62
|
+
|
63
|
+
suite 'empty' ->
|
64
|
+
test 'empty object as input' ->
|
65
|
+
ok empty {}
|
66
|
+
|
67
|
+
test 'non-empty object as input' ->
|
68
|
+
ok not empty {x: 1}
|
69
|
+
|
70
|
+
suite 'each' ->
|
71
|
+
test 'empty object as input' ->
|
72
|
+
deep-eq {}, each id, {}
|
73
|
+
|
74
|
+
test 'iterate over object values' ->
|
75
|
+
count = 4
|
76
|
+
each (-> count += it), {a: 1, b: 2, c: 3}
|
77
|
+
eq 10 count
|
78
|
+
|
79
|
+
test 'curried' ->
|
80
|
+
count = 4
|
81
|
+
f = each (-> count += it)
|
82
|
+
f {a: 1, b: 2, c: 3}
|
83
|
+
eq 10 count
|
84
|
+
|
85
|
+
suite 'map' ->
|
86
|
+
test 'empty object as input' ->
|
87
|
+
deep-eq {}, map id, {}
|
88
|
+
|
89
|
+
test 'mapping over object' ->
|
90
|
+
deep-eq {a:2, b:4}, map (* 2), {a:1, b:2}
|
91
|
+
|
92
|
+
test 'curried' ->
|
93
|
+
f = map (* 2)
|
94
|
+
deep-eq {a:2, b:4}, f {a:1, b:2}
|
95
|
+
|
96
|
+
suite 'compact' ->
|
97
|
+
test 'empty object as input' ->
|
98
|
+
deep-eq {}, compact {}
|
99
|
+
|
100
|
+
test 'compacting object' ->
|
101
|
+
deep-eq {b: 1, e: 'ha'}, compact {a: 0, b: 1, c: false, d: '', e: 'ha'}
|
102
|
+
|
103
|
+
suite 'filter' ->
|
104
|
+
test 'empty object as input' ->
|
105
|
+
deep-eq {}, filter id, {}
|
106
|
+
|
107
|
+
test 'filtering object' ->
|
108
|
+
deep-eq {b: 2}, filter (== 2), {a:1, b:2}
|
109
|
+
|
110
|
+
test 'curried' ->
|
111
|
+
f = filter (== 2)
|
112
|
+
deep-eq {b: 2}, f {a:1, b:2}
|
113
|
+
|
114
|
+
suite 'reject' ->
|
115
|
+
test 'empty object as input' ->
|
116
|
+
deep-eq {}, reject id, {}
|
117
|
+
|
118
|
+
test 'reject object' ->
|
119
|
+
deep-eq {a: 1}, reject (==2), {a:1, b:2}
|
120
|
+
|
121
|
+
test 'curried' ->
|
122
|
+
f = reject (== 2)
|
123
|
+
deep-eq {a: 1}, f {a:1, b:2}
|
124
|
+
|
125
|
+
suite 'partition' ->
|
126
|
+
test 'empty object as input' ->
|
127
|
+
deep-eq [{}, {}], partition id, {}
|
128
|
+
|
129
|
+
test 'partition object' ->
|
130
|
+
deep-eq [{b: 2}, {a: 1, c: 3}], partition (==2), {a:1, b:2, c:3}
|
131
|
+
|
132
|
+
test 'curried' ->
|
133
|
+
f = partition (== 2)
|
134
|
+
deep-eq [{b: 2}, {a: 1, c: 3}], f {a:1, b:2, c:3}
|
135
|
+
|
136
|
+
suite 'find' ->
|
137
|
+
test 'empty object as input' ->
|
138
|
+
eq void, find id, {}
|
139
|
+
|
140
|
+
test 'find from object' ->
|
141
|
+
eq 2, find (==2), {a:1, b:2}
|
142
|
+
|
143
|
+
test 'curried' ->
|
144
|
+
f = find (== 2)
|
145
|
+
eq 2, f {a:1, b:2}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
{id, is-type, replicate} = require '..'
|
2
|
+
{equal: eq, deep-equal: deep-eq, ok} = require 'assert'
|
3
|
+
|
4
|
+
suite 'id' ->
|
5
|
+
test 'number' ->
|
6
|
+
eq 5, id 5
|
7
|
+
|
8
|
+
test 'object is the same' ->
|
9
|
+
obj = {}
|
10
|
+
eq obj, id obj
|
11
|
+
|
12
|
+
suite 'is-type' ->
|
13
|
+
test 'literals' ->
|
14
|
+
ok is-type 'Undefined' void
|
15
|
+
ok is-type 'Boolean' true
|
16
|
+
ok is-type 'Number' 1
|
17
|
+
ok is-type 'Number' 1.2
|
18
|
+
ok is-type 'String' 'asdfa'
|
19
|
+
ok is-type 'Object' {}
|
20
|
+
ok is-type 'Array' []
|
21
|
+
|
22
|
+
ok not is-type 'Boolean' 1
|
23
|
+
|
24
|
+
test 'constructors' ->
|
25
|
+
ok is-type 'Date' new Date
|
26
|
+
|
27
|
+
test 'classes' ->
|
28
|
+
class A
|
29
|
+
|
30
|
+
ok is-type 'Object' new A
|
31
|
+
|
32
|
+
test 'curried' ->
|
33
|
+
f = is-type 'Boolean'
|
34
|
+
ok f true
|
35
|
+
|
36
|
+
suite 'replicate' ->
|
37
|
+
test 'zero as input' ->
|
38
|
+
deep-eq [], replicate 0 0
|
39
|
+
deep-eq [], replicate 0 'a'
|
40
|
+
|
41
|
+
test 'number as input' ->
|
42
|
+
deep-eq [3,3,3,3], replicate 4 3
|
43
|
+
|
44
|
+
test 'string as input' ->
|
45
|
+
deep-eq <[ a a a a ]>, replicate 4 'a'
|
46
|
+
|
47
|
+
test 'curried' ->
|
48
|
+
f = replicate 4
|
49
|
+
deep-eq [3,3,3,3], f 3
|