conjur-asset-ui 1.3.2 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.jshintrc +41 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +3 -1
- data/README.md +38 -4
- data/Rakefile +69 -1
- data/TODO.md +31 -0
- data/bower.json +98 -0
- data/conjur-asset-ui.gemspec +3 -3
- data/features/navigation_bar.feature +31 -0
- data/features/step_definitions/custom_step.rb +32 -0
- data/features/support/env.rb +38 -0
- data/features/support/hooks.rb +30 -0
- data/features/support/world.rb +17 -0
- data/gulpfile.js +139 -0
- data/lib/conjur/command/ui.rb +1 -1
- data/lib/conjur/webserver/server.rb +14 -8
- data/lib/conjur-asset-ui-version.rb +1 -1
- data/package.json +47 -0
- data/preprocessor.js +7 -0
- data/public/_client_libs.html +1 -16
- data/public/build/css/styles.css +87 -0
- data/public/build/css/vendor.css +5 -0
- data/public/build/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/{fonts → build/fonts}/glyphicons-halflings-regular.svg +47 -47
- data/public/{fonts → build/fonts}/glyphicons-halflings-regular.ttf +0 -0
- data/public/build/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/build/js/app.min.js +4 -0
- data/public/build/js/vendor.min.js +23 -0
- data/public/build/maps/app.min.js.map +1 -0
- data/public/build/maps/vendor.min.js.map +1 -0
- data/public/css/styles.less +246 -17
- data/public/index.html.erb +11 -10
- data/public/js/init.js +186 -97
- data/public/js/lib/sorted-set.no-require.js +3 -28
- data/public/js/models/groupRecord.js +14 -12
- data/public/js/models/hostRecord.js +13 -8
- data/public/js/models/layerRecord.js +14 -12
- data/public/js/models/namespace.js +2 -0
- data/public/js/models/policyList.js +3 -1
- data/public/js/models/policyRecord.js +8 -8
- data/public/js/models/record.js +59 -27
- data/public/js/models/resourceList.js +28 -10
- data/public/js/models/userList.js +7 -2
- data/public/js/models/userRecord.js +14 -9
- data/public/js/models/variableList.js +18 -7
- data/public/js/models/variableRecord.js +18 -14
- data/public/js/routers.js +74 -37
- data/public/js/views/annotations.js +39 -28
- data/public/js/views/audit.js +31 -25
- data/public/js/views/breadcrumbs.js +62 -0
- data/public/js/views/chart.js +617 -0
- data/public/js/views/dashboard.js +144 -65
- data/public/js/views/generic.js +16 -9
- data/public/js/views/group.js +103 -55
- data/public/js/views/groups.js +3 -7
- data/public/js/views/host.js +192 -56
- data/public/js/views/hosts.js +2 -6
- data/public/js/views/layer.js +136 -82
- data/public/js/views/layers.js +2 -6
- data/public/js/views/mixins/search.js +12 -5
- data/public/js/views/mixins/tabs.js +95 -55
- data/public/js/views/navSearch.js +16 -5
- data/public/js/views/owned.js +14 -8
- data/public/js/views/permissions.js +244 -178
- data/public/js/views/policies.js +2 -4
- data/public/js/views/policy.js +65 -38
- data/public/js/views/resource.js +54 -34
- data/public/js/views/role.js +59 -37
- data/public/js/views/searchResults.js +205 -138
- data/public/js/views/sections.js +226 -0
- data/public/js/views/time.js +38 -13
- data/public/js/views/user.js +288 -59
- data/public/js/views/users.js +2 -7
- data/public/js/views/variable.js +293 -53
- data/public/js/views/variables.js +4 -8
- metadata +34 -56
- data/.git-hooks/pre_commit/ensure_livescript_compiled.rb +0 -31
- data/.overcommit.yml +0 -5
- data/compile_ls +0 -6
- data/livescript/views/audit.ls +0 -136
- data/public/_client_code.html +0 -42
- data/public/css/bootstrap.css +0 -7
- data/public/fonts/glyphicons-halflings-regular.eot +0 -0
- data/public/fonts/glyphicons-halflings-regular.woff +0 -0
- data/public/js/lib/JSXTransformer.js +0 -10862
- data/public/js/lib/async.js +0 -958
- data/public/js/lib/backbone.js +0 -2
- data/public/js/lib/bootstrap.js +0 -6
- data/public/js/lib/date.extensions.js +0 -141
- data/public/js/lib/less.js +0 -16
- data/public/js/lib/moment.js +0 -7768
- data/public/js/lib/prelude-browser-min.js +0 -1
- data/public/js/lib/react-bootstrap.js +0 -5346
- data/public/js/lib/react-bootstrap.min.js +0 -4
- data/public/js/lib/underscore-min.js +0 -6
- data/public/js/lib/underscore.string.min.js +0 -1
- data/public/js/main.js +0 -57
- data/vendor/prelude-ls/.gitignore +0 -2
- data/vendor/prelude-ls/.travis.yml +0 -3
- data/vendor/prelude-ls/CHANGELOG.md +0 -81
- data/vendor/prelude-ls/LICENSE +0 -22
- data/vendor/prelude-ls/Makefile +0 -50
- data/vendor/prelude-ls/README.md +0 -15
- data/vendor/prelude-ls/browser/prelude-browser-min.js +0 -1
- data/vendor/prelude-ls/browser/prelude-browser.js +0 -1172
- data/vendor/prelude-ls/lib/Func.js +0 -40
- data/vendor/prelude-ls/lib/List.js +0 -602
- data/vendor/prelude-ls/lib/Num.js +0 -129
- data/vendor/prelude-ls/lib/Obj.js +0 -153
- data/vendor/prelude-ls/lib/Str.js +0 -68
- data/vendor/prelude-ls/lib/index.js +0 -164
- data/vendor/prelude-ls/package.json +0 -50
- data/vendor/prelude-ls/package.ls +0 -46
- data/vendor/prelude-ls/src/Func.ls +0 -17
- data/vendor/prelude-ls/src/List.ls +0 -299
- data/vendor/prelude-ls/src/Num.ls +0 -83
- data/vendor/prelude-ls/src/Obj.ls +0 -61
- data/vendor/prelude-ls/src/Str.ls +0 -32
- data/vendor/prelude-ls/src/index.ls +0 -56
- data/vendor/prelude-ls/test/Func.ls +0 -36
- data/vendor/prelude-ls/test/List.ls +0 -751
- data/vendor/prelude-ls/test/Num.ls +0 -258
- data/vendor/prelude-ls/test/Obj.ls +0 -145
- data/vendor/prelude-ls/test/Prelude.ls +0 -49
- data/vendor/prelude-ls/test/Str.ls +0 -208
- data/vendor/prelude-ls/test/browser.html +0 -5
@@ -1,50 +0,0 @@
|
|
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
|
-
}
|
@@ -1,46 +0,0 @@
|
|
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'
|
@@ -1,17 +0,0 @@
|
|
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
|
-
}
|
@@ -1,299 +0,0 @@
|
|
1
|
-
each = (f, xs) -->
|
2
|
-
for x in xs then f x
|
3
|
-
xs
|
4
|
-
|
5
|
-
map = (f, xs) -->
|
6
|
-
[f x for x in xs]
|
7
|
-
|
8
|
-
compact = (xs) -->
|
9
|
-
[x for x in xs when x]
|
10
|
-
|
11
|
-
filter = (f, xs) -->
|
12
|
-
[x for x in xs when f x]
|
13
|
-
|
14
|
-
reject = (f, xs) -->
|
15
|
-
[x for x in xs when not f x]
|
16
|
-
|
17
|
-
partition = (f, xs) -->
|
18
|
-
passed = []
|
19
|
-
failed = []
|
20
|
-
for x in xs
|
21
|
-
(if f x then passed else failed).push x
|
22
|
-
[passed, failed]
|
23
|
-
|
24
|
-
find = (f, xs) -->
|
25
|
-
for x in xs when f x then return x
|
26
|
-
void
|
27
|
-
|
28
|
-
head = first = (xs) ->
|
29
|
-
return void unless xs.length
|
30
|
-
xs.0
|
31
|
-
|
32
|
-
tail = (xs) ->
|
33
|
-
return void unless xs.length
|
34
|
-
xs.slice 1
|
35
|
-
|
36
|
-
last = (xs) ->
|
37
|
-
return void unless xs.length
|
38
|
-
xs[*-1]
|
39
|
-
|
40
|
-
initial = (xs) ->
|
41
|
-
len = xs.length
|
42
|
-
return void unless len
|
43
|
-
xs.slice 0, len - 1
|
44
|
-
|
45
|
-
empty = (xs) ->
|
46
|
-
not xs.length
|
47
|
-
|
48
|
-
reverse = (xs) ->
|
49
|
-
xs.concat!.reverse!
|
50
|
-
|
51
|
-
unique = (xs) ->
|
52
|
-
result = []
|
53
|
-
for x in xs when x not in result
|
54
|
-
result.push x
|
55
|
-
result
|
56
|
-
|
57
|
-
fold = foldl = (f, memo, xs) -->
|
58
|
-
for x in xs then memo = f memo, x
|
59
|
-
memo
|
60
|
-
|
61
|
-
fold1 = foldl1 = (f, xs) -->
|
62
|
-
fold f, xs.0, xs.slice 1
|
63
|
-
|
64
|
-
foldr = (f, memo, xs) -->
|
65
|
-
fold f, memo, (xs.concat!.reverse!)
|
66
|
-
|
67
|
-
foldr1 = (f, xs) -->
|
68
|
-
ys = xs.concat!.reverse!
|
69
|
-
fold f, ys.0, ys.slice 1
|
70
|
-
|
71
|
-
unfoldr = (f, b) -->
|
72
|
-
result = []
|
73
|
-
x = b
|
74
|
-
while (f x)?
|
75
|
-
result.push that.0
|
76
|
-
x = that.1
|
77
|
-
result
|
78
|
-
|
79
|
-
concat = (xss) ->
|
80
|
-
[].concat.apply [], xss
|
81
|
-
|
82
|
-
concat-map = (f, xs) -->
|
83
|
-
[].concat.apply [], [f x for x in xs]
|
84
|
-
|
85
|
-
flatten = (xs) -->
|
86
|
-
[].concat.apply [], [(if typeof! x is 'Array' then flatten x else x) for x in xs]
|
87
|
-
|
88
|
-
difference = (xs, ...yss) ->
|
89
|
-
results = []
|
90
|
-
:outer for x in xs
|
91
|
-
for ys in yss
|
92
|
-
continue outer if x in ys
|
93
|
-
results.push x
|
94
|
-
results
|
95
|
-
|
96
|
-
intersection = (xs, ...yss) ->
|
97
|
-
results = []
|
98
|
-
:outer for x in xs
|
99
|
-
for ys in yss
|
100
|
-
continue outer unless x in ys
|
101
|
-
results.push x
|
102
|
-
results
|
103
|
-
|
104
|
-
union = (...xss) ->
|
105
|
-
results = []
|
106
|
-
for xs in xss
|
107
|
-
for x in xs
|
108
|
-
results.push x unless x in results
|
109
|
-
results
|
110
|
-
|
111
|
-
count-by = (f, xs) -->
|
112
|
-
results = {}
|
113
|
-
for x in xs
|
114
|
-
key = f x
|
115
|
-
if key of results
|
116
|
-
results[key] += 1
|
117
|
-
else
|
118
|
-
results[key] = 1
|
119
|
-
results
|
120
|
-
|
121
|
-
group-by = (f, xs) -->
|
122
|
-
results = {}
|
123
|
-
for x in xs
|
124
|
-
key = f x
|
125
|
-
if key of results
|
126
|
-
results[key].push x
|
127
|
-
else
|
128
|
-
results[key] = [x]
|
129
|
-
results
|
130
|
-
|
131
|
-
and-list = (xs) ->
|
132
|
-
for x in xs when not x
|
133
|
-
return false
|
134
|
-
true
|
135
|
-
|
136
|
-
or-list = (xs) ->
|
137
|
-
for x in xs when x
|
138
|
-
return true
|
139
|
-
false
|
140
|
-
|
141
|
-
any = (f, xs) -->
|
142
|
-
for x in xs when f x
|
143
|
-
return true
|
144
|
-
false
|
145
|
-
|
146
|
-
all = (f, xs) -->
|
147
|
-
for x in xs when not f x
|
148
|
-
return false
|
149
|
-
true
|
150
|
-
|
151
|
-
sort = (xs) ->
|
152
|
-
xs.concat!.sort (x, y) ->
|
153
|
-
if x > y
|
154
|
-
1
|
155
|
-
else if x < y
|
156
|
-
-1
|
157
|
-
else
|
158
|
-
0
|
159
|
-
|
160
|
-
sort-with = (f, xs) -->
|
161
|
-
return [] unless xs.length
|
162
|
-
xs.concat!.sort f
|
163
|
-
|
164
|
-
sort-by = (f, xs) -->
|
165
|
-
return [] unless xs.length
|
166
|
-
xs.concat!.sort (x, y) ->
|
167
|
-
if (f x) > (f y)
|
168
|
-
1
|
169
|
-
else if (f x) < (f y)
|
170
|
-
-1
|
171
|
-
else
|
172
|
-
0
|
173
|
-
|
174
|
-
sum = (xs) ->
|
175
|
-
result = 0
|
176
|
-
for x in xs
|
177
|
-
result += x
|
178
|
-
result
|
179
|
-
|
180
|
-
product = (xs) ->
|
181
|
-
result = 1
|
182
|
-
for x in xs
|
183
|
-
result *= x
|
184
|
-
result
|
185
|
-
|
186
|
-
mean = average = (xs) ->
|
187
|
-
sum = 0
|
188
|
-
len = xs.length
|
189
|
-
for i til len
|
190
|
-
sum += xs[i]
|
191
|
-
sum / len
|
192
|
-
|
193
|
-
maximum = (xs) ->
|
194
|
-
max = xs.0
|
195
|
-
for x in xs.slice 1 when x > max
|
196
|
-
max = x
|
197
|
-
max
|
198
|
-
|
199
|
-
minimum = (xs) ->
|
200
|
-
min = xs.0
|
201
|
-
for x in xs.slice 1 when x < min
|
202
|
-
min = x
|
203
|
-
min
|
204
|
-
|
205
|
-
scan = scanl = (f, memo, xs) -->
|
206
|
-
last = memo
|
207
|
-
[memo] ++ [last = f last, x for x in xs]
|
208
|
-
|
209
|
-
scan1 = scanl1 = (f, xs) -->
|
210
|
-
return void unless xs.length
|
211
|
-
scan f, xs.0, xs.slice 1
|
212
|
-
|
213
|
-
scanr = (f, memo, xs) -->
|
214
|
-
xs = xs.concat!.reverse!
|
215
|
-
(scan f, memo, xs).reverse!
|
216
|
-
|
217
|
-
scanr1 = (f, xs) -->
|
218
|
-
return void unless xs.length
|
219
|
-
xs = xs.concat!.reverse!
|
220
|
-
(scan f, xs.0, xs.slice 1).reverse!
|
221
|
-
|
222
|
-
slice = (x, y, xs) -->
|
223
|
-
xs.slice x, y
|
224
|
-
|
225
|
-
take = (n, xs) -->
|
226
|
-
if n <= 0
|
227
|
-
xs.slice 0, 0
|
228
|
-
else if not xs.length
|
229
|
-
xs
|
230
|
-
else
|
231
|
-
xs.slice 0, n
|
232
|
-
|
233
|
-
drop = (n, xs) -->
|
234
|
-
if n <= 0 or not xs.length
|
235
|
-
xs
|
236
|
-
else
|
237
|
-
xs.slice n
|
238
|
-
|
239
|
-
split-at = (n, xs) --> [(take n, xs), (drop n, xs)]
|
240
|
-
|
241
|
-
take-while = (p, xs) -->
|
242
|
-
len = xs.length
|
243
|
-
return xs unless len
|
244
|
-
i = 0
|
245
|
-
while i < len and p xs[i]
|
246
|
-
i += 1
|
247
|
-
xs.slice 0 i
|
248
|
-
|
249
|
-
drop-while = (p, xs) -->
|
250
|
-
len = xs.length
|
251
|
-
return xs unless len
|
252
|
-
i = 0
|
253
|
-
while i < len and p xs[i]
|
254
|
-
i += 1
|
255
|
-
xs.slice i
|
256
|
-
|
257
|
-
span = (p, xs) --> [(take-while p, xs), (drop-while p, xs)]
|
258
|
-
|
259
|
-
break-list = (p, xs) --> span (not) << p, xs
|
260
|
-
|
261
|
-
zip = (xs, ys) -->
|
262
|
-
result = []
|
263
|
-
len = ys.length
|
264
|
-
for x, i in xs
|
265
|
-
break if i is len
|
266
|
-
result.push [x, ys[i]]
|
267
|
-
result
|
268
|
-
|
269
|
-
zip-with = (f, xs, ys) -->
|
270
|
-
result = []
|
271
|
-
len = ys.length
|
272
|
-
for x, i in xs
|
273
|
-
break if i is len
|
274
|
-
result.push f x, ys[i]
|
275
|
-
result
|
276
|
-
|
277
|
-
zip-all = (...xss) ->
|
278
|
-
min-length = 9e9
|
279
|
-
for xs in xss
|
280
|
-
min-length <?= xs.length
|
281
|
-
[[xs[i] for xs in xss] for i til min-length]
|
282
|
-
|
283
|
-
zip-all-with = (f, ...xss) ->
|
284
|
-
min-length = 9e9
|
285
|
-
for xs in xss
|
286
|
-
min-length <?= xs.length
|
287
|
-
[f.apply(null, [xs[i] for xs in xss]) for i til min-length]
|
288
|
-
|
289
|
-
module.exports = {
|
290
|
-
each, map, filter, compact, reject, partition, find,
|
291
|
-
head, first, tail, last, initial, empty,
|
292
|
-
reverse, difference, intersection, union, count-by, group-by,
|
293
|
-
fold, fold1, foldl, foldl1, foldr, foldr1, unfoldr, and-list, or-list,
|
294
|
-
any, all, unique, sort, sort-with, sort-by, sum, product, mean, average,
|
295
|
-
concat, concat-map, flatten,
|
296
|
-
maximum, minimum, scan, scan1, scanl, scanl1, scanr, scanr1,
|
297
|
-
slice, take, drop, split-at, take-while, drop-while, span, break-list,
|
298
|
-
zip, zip-with, zip-all, zip-all-with,
|
299
|
-
}
|
@@ -1,83 +0,0 @@
|
|
1
|
-
max = (>?)
|
2
|
-
|
3
|
-
min = (<?)
|
4
|
-
|
5
|
-
negate = (x) -> -x
|
6
|
-
|
7
|
-
abs = Math.abs
|
8
|
-
|
9
|
-
signum = (x) ->
|
10
|
-
if x < 0
|
11
|
-
-1
|
12
|
-
else if x > 0
|
13
|
-
1
|
14
|
-
else
|
15
|
-
0
|
16
|
-
|
17
|
-
quot = (x, y) --> ~~(x / y)
|
18
|
-
|
19
|
-
rem = (%)
|
20
|
-
|
21
|
-
div = (x, y) --> Math.floor x / y
|
22
|
-
|
23
|
-
mod = (%%)
|
24
|
-
|
25
|
-
recip = (1 /)
|
26
|
-
|
27
|
-
pi = Math.PI
|
28
|
-
|
29
|
-
tau = pi * 2
|
30
|
-
|
31
|
-
exp = Math.exp
|
32
|
-
|
33
|
-
sqrt = Math.sqrt
|
34
|
-
|
35
|
-
ln = Math.log
|
36
|
-
|
37
|
-
pow = (^)
|
38
|
-
|
39
|
-
sin = Math.sin
|
40
|
-
|
41
|
-
tan = Math.tan
|
42
|
-
|
43
|
-
cos = Math.cos
|
44
|
-
|
45
|
-
asin = Math.asin
|
46
|
-
|
47
|
-
acos = Math.acos
|
48
|
-
|
49
|
-
atan = Math.atan
|
50
|
-
|
51
|
-
atan2 = (x, y) --> Math.atan2 x, y
|
52
|
-
|
53
|
-
truncate = (x) -> ~~x
|
54
|
-
|
55
|
-
round = Math.round
|
56
|
-
|
57
|
-
ceiling = Math.ceil
|
58
|
-
|
59
|
-
floor = Math.floor
|
60
|
-
|
61
|
-
is-it-NaN = (x) -> x isnt x
|
62
|
-
|
63
|
-
even = (x) -> x % 2 == 0
|
64
|
-
|
65
|
-
odd = (x) -> x % 2 != 0
|
66
|
-
|
67
|
-
gcd = (x, y) -->
|
68
|
-
x = Math.abs x
|
69
|
-
y = Math.abs y
|
70
|
-
until y is 0
|
71
|
-
z = x % y
|
72
|
-
x = y
|
73
|
-
y = z
|
74
|
-
x
|
75
|
-
|
76
|
-
lcm = (x, y) -->
|
77
|
-
Math.abs Math.floor (x / (gcd x, y) * y)
|
78
|
-
|
79
|
-
module.exports = {
|
80
|
-
max, min, negate, abs, signum, quot, rem, div, mod, recip,
|
81
|
-
pi, tau, exp, sqrt, ln, pow, sin, tan, cos, acos, asin, atan, atan2,
|
82
|
-
truncate, round, ceiling, floor, is-it-NaN, even, odd, gcd, lcm,
|
83
|
-
}
|