-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
322 lines (296 loc) · 17.9 KB
/
index.html
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<script src="gs-utils.js"></script>
<script>
function lg( a ) { return console.log( ...arguments ), a; }
let tests = 0;
let testsPassed = 0;
function test( id, val, expected ) {
if ( val === expected ) {
++testsPassed;
} else {
console.log( `test:${ id }`, val, "!==", expected );
}
++tests;
}
// test( "xxxxxx.0", xxxxxx(), 123456 );
test( "GSUnoop.0", GSUnoop(), undefined );
test( "GSUnoop.1", GSUnoop( 1 ), undefined );
test( "GSUnoopFalse.0", GSUnoopFalse(), false );
test( "GSUnoopFalse.1", GSUnoopFalse( true ), false );
// GSUisXxxxx ..................................................................
test( "GSUisObj.0", GSUisObj(), false );
test( "GSUisObj.1", GSUisObj( NaN ), false );
test( "GSUisObj.2", GSUisObj( null ), false );
test( "GSUisObj.3", GSUisObj( true ), false );
test( "GSUisObj.4", GSUisObj( false ), false );
test( "GSUisObj.5", GSUisObj( undefined ), false );
test( "GSUisObj.6", GSUisObj( GSUnoop ), false );
test( "GSUisObj.7", GSUisObj( {} ), true );
test( "GSUisObj.8", GSUisObj( [] ), true );
test( "GSUisObj.9", GSUisObj( 21 ), false );
test( "GSUisObj.a", GSUisObj( "abc" ), false );
// ....................................
test( "GSUisNoop.0", GSUisNoop( GSUnoop ), true );
test( "GSUisNoop.1", GSUisNoop( GSUnoopFalse ), true );
// ....................................
test( "GSUisStr.0", GSUisStr(), false );
test( "GSUisStr.1", GSUisStr( NaN ), false );
test( "GSUisStr.2", GSUisStr( null ), false );
test( "GSUisStr.3", GSUisStr( true ), false );
test( "GSUisStr.4", GSUisStr( false ), false );
test( "GSUisStr.5", GSUisStr( undefined ), false );
test( "GSUisStr.7", GSUisStr( GSUnoop ), false );
test( "GSUisStr.8", GSUisStr( {} ), false );
test( "GSUisStr.9", GSUisStr( [] ), false );
test( "GSUisStr.a", GSUisStr( "" ), true );
test( "GSUisStr.b", GSUisStr( "0" ), true );
// ....................................
test( "GSUisNum.0", GSUisNum(), false );
test( "GSUisNum.1", GSUisNum( NaN ), false );
test( "GSUisNum.2", GSUisNum( null ), false );
test( "GSUisNum.3", GSUisNum( true ), false );
test( "GSUisNum.4", GSUisNum( false ), false );
test( "GSUisNum.5", GSUisNum( undefined ), false );
test( "GSUisNum.6", GSUisNum( GSUnoop ), false );
test( "GSUisNum.7", GSUisNum( {} ), false );
test( "GSUisNum.8", GSUisNum( [] ), false );
test( "GSUisNum.9", GSUisNum( "" ), false );
test( "GSUisNum.a", GSUisNum( 0 ), true );
test( "GSUisNum.b", GSUisNum( 21.5 ), true );
test( "GSUisNum.c", GSUisNum( "21" ), false );
test( "GSUisNum.d", GSUisNum( "abc" ), false );
// ....................................
test( "GSUisFun.0", GSUisFun(), false );
test( "GSUisFun.1", GSUisFun( NaN ), false );
test( "GSUisFun.2", GSUisFun( null ), false );
test( "GSUisFun.3", GSUisFun( true ), false );
test( "GSUisFun.4", GSUisFun( false ), false );
test( "GSUisFun.5", GSUisFun( undefined ), false );
test( "GSUisFun.6", GSUisFun( {} ), false );
test( "GSUisFun.7", GSUisFun( [] ), false );
test( "GSUisFun.8", GSUisFun( "" ), false );
test( "GSUisFun.9", GSUisFun( "21" ), false );
test( "GSUisFun.a", GSUisFun( 0 ), false );
test( "GSUisFun.b", GSUisFun( GSUnoop ), true );
test( "GSUisFun.c", GSUisFun( () => {} ), true );
// GSUforEach/reduce ...........................................................
const objFE = { a: 10, b: 20 };
const arrFE = [ 10, 20 ];
let resFE;
test( "GSUforEach.0", GSUforEach( objFE, GSUnoop ), objFE );
test( "GSUforEach.1", GSUforEach( arrFE, GSUnoop ), arrFE );
test( "GSUforEach.2", GSUforEach( null, GSUnoop ), null );
test( "GSUforEach.3", GSUforEach( false, GSUnoop ), false );
test( "GSUforEach.4", GSUforEach( undefined, GSUnoop ), undefined );
test( "GSUforEach.5", GSUforEach( true, GSUnoop ), true );
test( "GSUforEach.6", GSUforEach( 21, GSUnoop ), 21 );
resFE = "";
GSUforEach( objFE, ( val, key, obj ) => { resFE += `${ key }:${ val }:${ obj === objFE }:` } );
test( "GSUforEach.7", resFE, "a:10:true:b:20:true:" );
resFE = "";
GSUforEach( arrFE, ( val, key, obj ) => { resFE += `${ key }:${ val }:${ obj === arrFE }:` } );
test( "GSUforEach.8", resFE, "0:10:true:1:20:true:" );
// ....................................
const fnSum = ( sum, n, i ) => sum + n + i;
test( "GSUreduce.0", GSUreduce( [], fnSum, 0 ), 0 );
test( "GSUreduce.1", GSUreduce( {}, fnSum, 0 ), 0 );
test( "GSUreduce.2", GSUreduce( [ 10, 20, 30 ], fnSum, 0 ), 63 );
test( "GSUreduce.3", GSUreduce( { a: 10, b: 20, c: 30 }, fnSum, 0 ), "10a20b30c" );
// .............................................................................
test( "GSUeaseInCirc.0", GSUeaseInCirc( 0 ), 0 );
test( "GSUeaseInCirc.1", GSUeaseInCirc( 1 ), 1 );
test( "GSUeaseInCirc.2", GSUeaseInCirc( .25 ), .031754163448145745 );
test( "GSUeaseInCirc.3", GSUeaseInCirc( .5 ), .1339745962155614 );
test( "GSUeaseInCirc.4", GSUeaseInCirc( .75 ), .3385621722338523 );
test( "GSUeaseInCirc.5", GSUeaseInCirc( .25, 2 ), .031754163448145745 );
test( "GSUeaseInCirc.6", GSUeaseInCirc( .25, 3 ), .007843258350778481 );
test( "GSUeaseInCirc.7", GSUeaseInCirc( .25, 4 ), .001955036083043038 );
// ....................................
test( "GSUeaseOutCirc.0", GSUeaseOutCirc( 0 ), 0 );
test( "GSUeaseOutCirc.1", GSUeaseOutCirc( 1 ), 1 );
test( "GSUeaseOutCirc.2", GSUeaseOutCirc( .25 ), .6614378277661477 );
test( "GSUeaseOutCirc.3", GSUeaseOutCirc( .5 ), .8660254037844386 );
test( "GSUeaseOutCirc.4", GSUeaseOutCirc( .75 ), .9682458365518543 );
test( "GSUeaseOutCirc.5", GSUeaseOutCirc( .25, 2 ), .6614378277661477 );
test( "GSUeaseOutCirc.6", GSUeaseOutCirc( .25, 3 ), 1.192424001771182 ); // ???
test( "GSUeaseOutCirc.7", GSUeaseOutCirc( .25, 4 ), .8267972847076845 );
// .............................................................................
test( "GSUnewArray.0", JSON.stringify( GSUnewArray( 0 ) ), "[]" );
test( "GSUnewArray.1", JSON.stringify( GSUnewArray( 1 ) ), JSON.stringify( [ undefined ] ) );
test( "GSUnewArray.2", JSON.stringify( GSUnewArray( 2 ) ), JSON.stringify( [ undefined, undefined ] ) );
test( "GSUnewArray.3", JSON.stringify( GSUnewArray( 3, 7 ) ), "[7,7,7]" );
test( "GSUnewArray.4", JSON.stringify( GSUnewArray( 3, i => i ) ), "[0,1,2]" );
const objEmpty = {};
const arrEmpty = [];
const arr123 = [ 1, 2, 3 ];
test( "GSUarrayFrom.0", GSUarrayFrom( arr123 ), arr123 );
test( "GSUarrayFrom.1", GSUarrayFrom( arrEmpty ), arrEmpty );
test( "GSUarrayFrom.2", GSUarrayFrom( objEmpty )[ 0 ], objEmpty );
// test( "GSUarrayFrom.2", GSUarrayFrom( 21 )[ 0 ], 21 );
test( "GSUisEmpty.0", GSUisEmpty( {} ), true );
test( "GSUisEmpty.1", GSUisEmpty( [] ), true );
test( "GSUisEmpty.5", GSUisEmpty( "" ), true );
test( "GSUisEmpty.6", GSUisEmpty( "0" ), false );
test( "GSUisEmpty.2", GSUisEmpty( [ 0 ] ), false );
test( "GSUisEmpty.3", GSUisEmpty( { a: null } ), false );
test( "GSUisEmpty.4", GSUisEmpty( { a: undefined } ), false );
test( "GSUisEmpty.7", GSUisEmpty( null ), true );
test( "GSUisEmpty.8", GSUisEmpty( undefined ), true );
test( "GSUisEmpty.9", GSUisEmpty( 21 ), true );
test( "GSUisEmpty.a", GSUisEmpty( NaN ), true );
test( "GSUisEmpty.b", GSUisEmpty( true ), true );
test( "GSUisEmpty.c", GSUisEmpty( false ), true );
test( "GSUtrim2.0", GSUtrim2( "" ), "" );
test( "GSUtrim2.1", GSUtrim2( "a" ), "a" );
test( "GSUtrim2.2", GSUtrim2( "a b c" ), "a b c" );
test( "GSUtrim2.3", GSUtrim2( " a b c " ), "a b c" );
test( "GSUtrim2.4", GSUtrim2( " \t a b\tc \t " ), "a b c" );
test( "GSUtrim2.5", GSUtrim2( 21 ), "" );
test( "GSUtrim2.6", GSUtrim2( NaN ), "" );
test( "GSUtrim2.7", GSUtrim2( true ), "" );
test( "GSUtrim2.8", GSUtrim2( false ), "" );
test( "GSUtrim2.9", GSUtrim2( null ), "" );
test( "GSUtrim2.a", GSUtrim2( undefined ), "" );
test( "GSUtrim2.b", GSUtrim2( {} ), "" );
test( "GSUtrim2.c", GSUtrim2( [] ), "" );
test( "GSUsignNum.0", GSUsignNum( +0 ), "+0" );
test( "GSUsignNum.1", GSUsignNum( -0 ), "+0" );
test( "GSUsignNum.2", GSUsignNum( 1 ), "+1" );
test( "GSUsignNum.3", GSUsignNum( -1 ), "-1" );
test( "GSUsignNum.4", GSUsignNum( .009 ), "+0.009" );
test( "GSUsignNum.5", GSUsignNum( -.009 ), "-0.009" );
// .............................................................................
test( "GSUsplitNums.0", JSON.stringify( GSUsplitNums( 21 ) ), "[]" );
test( "GSUsplitNums.1", JSON.stringify( GSUsplitNums( NaN ) ), "[]" );
test( "GSUsplitNums.2", JSON.stringify( GSUsplitNums( null ) ), "[]" );
test( "GSUsplitNums.3", JSON.stringify( GSUsplitNums( true ) ), "[]" );
test( "GSUsplitNums.4", JSON.stringify( GSUsplitNums( false ) ), "[]" );
test( "GSUsplitNums.5", JSON.stringify( GSUsplitNums( undefined ) ), "[]" );
test( "GSUsplitNums.6", JSON.stringify( GSUsplitNums( GSUnoop ) ), "[]" );
test( "GSUsplitNums.7", JSON.stringify( GSUsplitNums( "" ) ), "[]" );
test( "GSUsplitNums.8", JSON.stringify( GSUsplitNums( "1" ) ), "[1]" );
test( "GSUsplitNums.9", JSON.stringify( GSUsplitNums( "1 2 3" ) ), "[1,2,3]" );
test( "GSUsplitNums.a", JSON.stringify( GSUsplitNums( "7", "," ) ), "[7]" );
test( "GSUsplitNums.b", JSON.stringify( GSUsplitNums( "1/2/foo", "/" ) ), "[1,2,0]" );
test( "GSUsplitNums.c", JSON.stringify( GSUsplitNums( "3/4", "/" ) ), "[3,4]" );
test( "GSUsplitNums.d", JSON.stringify( GSUsplitNums( "1.2/-3.14", "/" ) ), "[1.2,-3.14]" );
test( "GSUsplitNums.e", JSON.stringify( GSUsplitNums( "//", "/" ) ), "[0,0,0]" );
// ....................................
test( "GSUsplitInts.0", JSON.stringify( GSUsplitInts( 21 ) ), "[]" );
test( "GSUsplitInts.1", JSON.stringify( GSUsplitInts( NaN ) ), "[]" );
test( "GSUsplitInts.2", JSON.stringify( GSUsplitInts( null ) ), "[]" );
test( "GSUsplitInts.3", JSON.stringify( GSUsplitInts( true ) ), "[]" );
test( "GSUsplitInts.4", JSON.stringify( GSUsplitInts( false ) ), "[]" );
test( "GSUsplitInts.5", JSON.stringify( GSUsplitInts( undefined ) ), "[]" );
test( "GSUsplitInts.6", JSON.stringify( GSUsplitInts( GSUnoop ) ), "[]" );
test( "GSUsplitInts.7", JSON.stringify( GSUsplitInts( "" ) ), "[]" );
test( "GSUsplitInts.8", JSON.stringify( GSUsplitInts( "1", "/" ) ), "[1]" );
test( "GSUsplitInts.9", JSON.stringify( GSUsplitInts( "1.5/3.15", "/" ) ), "[1,3]" );
test( "GSUsplitInts.a", JSON.stringify( GSUsplitInts( "-1.5/-3.15", "/" ) ), "[-1,-3]" );
test( "GSUsplitInts.b", JSON.stringify( GSUsplitInts( "1/2", "/" ) ), "[1,2]" );
test( "GSUsplitInts.c", JSON.stringify( GSUsplitInts( "1/2/foo", "/" ) ), "[1,2,0]" );
test( "GSUsplitInts.d", JSON.stringify( GSUsplitInts( "1/2//3", "/" ) ), "[1,2,0,3]" );
test( "GSUsplitInts.e", JSON.stringify( GSUsplitInts( "//", "/" ) ), "[0,0,0]" );
// .............................................................................
test( "GSUinRange.0", GSUinRange( 0, 0, 1 ), true );
test( "GSUinRange.1", GSUinRange( 20, 20, 22 ), true );
test( "GSUinRange.2", GSUinRange( 21, 20, 22 ), true );
test( "GSUinRange.3", GSUinRange( 22, 20, 22 ), true );
test( "GSUinRange.4", GSUinRange( 20, 22, 20 ), true );
test( "GSUinRange.5", GSUinRange( 21, 22, 20 ), true );
test( "GSUinRange.6", GSUinRange( 22, 22, 20 ), true );
test( "GSUinRange.7", GSUinRange( -20, -20, -22 ), true );
test( "GSUinRange.8", GSUinRange( -21, -20, -22 ), true );
test( "GSUinRange.9", GSUinRange( -22, -20, -22 ), true );
test( "GSUinRange.a", GSUinRange( -20, -22, -20 ), true );
test( "GSUinRange.b", GSUinRange( -21, -22, -20 ), true );
test( "GSUinRange.c", GSUinRange( -22, -22, -20 ), true );
test( "GSUinRange.d", GSUinRange( .1, 0, 0 ), false );
test( "GSUinRange.e", GSUinRange( -.1, 0, 0 ), false );
test( "GSUinRange.f", GSUinRange( 2, 0, 1 ), false );
test( "GSUinRange.g", GSUinRange( -1, 0, 1 ), false );
test( "GSUinRange.h", GSUinRange( -.001, 0, 1 ), false );
test( "GSUinRange.i", GSUinRange( 1.001, 0, 1 ), false );
test( "GSUinRange.j", GSUinRange( undefined, -Infinity, Infinity ), false );
test( "GSUinRange.k", GSUinRange( NaN, -Infinity, Infinity ), false );
test( "GSUinRange.l", GSUinRange( null, -Infinity, Infinity ), false );
test( "GSUinRange.m", GSUinRange( "-0.5", -Infinity, Infinity ), true );
test( "GSUinRange.n", GSUinRange( "0", -Infinity, Infinity ), true );
test( "GSUinRange.o", GSUinRange( "21", -Infinity, Infinity ), true );
test( "GSUinRange.p", GSUinRange( "a", -Infinity, Infinity ), false );
test( "GSUinRange.q", GSUinRange( "", -Infinity, Infinity ), false );
test( "GSUinRange.r", GSUinRange( false, -Infinity, Infinity ), false );
test( "GSUinRange.s", GSUinRange( true, -Infinity, Infinity ), false );
test( "GSUclampNum.0", GSUclampNum( 19, 20, 30 ), 20 );
test( "GSUclampNum.1", GSUclampNum( 20, 20, 30 ), 20 );
test( "GSUclampNum.2", GSUclampNum( 21, 20, 30 ), 21 );
test( "GSUclampNum.3", GSUclampNum( 29, 20, 30 ), 29 );
test( "GSUclampNum.4", GSUclampNum( 30, 20, 30 ), 30 );
test( "GSUclampNum.5", GSUclampNum( 31, 20, 30 ), 30 );
test( "GSUclampNum.6", GSUclampNum( -19, -20, -30 ), -20 );
test( "GSUclampNum.7", GSUclampNum( -20, -20, -30 ), -20 );
test( "GSUclampNum.8", GSUclampNum( -21, -20, -30 ), -21 );
test( "GSUclampNum.9", GSUclampNum( -29, -20, -30 ), -29 );
test( "GSUclampNum.a", GSUclampNum( -30, -20, -30 ), -30 );
test( "GSUclampNum.b", GSUclampNum( -31, -20, -30 ), -30 );
test( "GSUapproxEqual.0", GSUapproxEqual( 0, 0, 0 ), true );
test( "GSUapproxEqual.1", GSUapproxEqual( -0, -0, 0 ), true );
test( "GSUapproxEqual.2", GSUapproxEqual( 21, 21, 0 ), true );
test( "GSUapproxEqual.3", GSUapproxEqual( 20.9, 21, .1 ), true );
test( "GSUapproxEqual.4", GSUapproxEqual( 21.1, 21, .1 ), true );
test( "GSUapproxEqual.5", GSUapproxEqual( 80, 100, 20 ), true );
test( "GSUapproxEqual.6", GSUapproxEqual( 120, 100, 20 ), true );
test( "GSUapproxEqual.7", GSUapproxEqual( 120.1, 100, 20 ), false );
test( "GSUapproxEqual.8", GSUapproxEqual( 79.9, 100, 20 ), false );
test( "GSUapproxEqual.9", GSUapproxEqual( 21.1, 21, 0 ), false );
test( "GSUapproxEqual.a", GSUapproxEqual( 20.8, 21, .1 ), false );
test( "GSUapproxEqual.b", GSUapproxEqual( 21.2, 21, .1 ), false );
test( "GSUapproxEqual.c", GSUapproxEqual( -21, -21, 0 ), true );
test( "GSUapproxEqual.d", GSUapproxEqual( -20.9, -21, .1 ), true );
test( "GSUapproxEqual.e", GSUapproxEqual( -21.1, -21, .1 ), true );
test( "GSUapproxEqual.f", GSUapproxEqual( -80, -100, 20 ), true );
test( "GSUapproxEqual.g", GSUapproxEqual( -120, -100, 20 ), true );
test( "GSUapproxEqual.h", GSUapproxEqual( -120.1, -100, 20 ), false );
test( "GSUapproxEqual.i", GSUapproxEqual( -79.9, -100, 20 ), false );
test( "GSUapproxEqual.j", GSUapproxEqual( -21.1, -21, 0 ), false );
test( "GSUapproxEqual.k", GSUapproxEqual( -20.8, -21, .1 ), false );
test( "GSUapproxEqual.l", GSUapproxEqual( -21.2, -21, .1 ), false );
test( "GSUroundNum.0", GSUroundNum( null ), 0 );
test( "GSUroundNum.1", GSUroundNum( true ), 1 );
test( "GSUroundNum.2", GSUroundNum( false ), 0 );
test( "GSUroundNum.3", GSUroundNum( undefined ), 0 );
test( "GSUroundNum.4", GSUroundNum( GSUnoop ), 0 );
test( "GSUroundNum.5", GSUroundNum( 0 ), 0 );
test( "GSUroundNum.6", GSUroundNum( 21 ), 21 );
test( "GSUroundNum.7", GSUroundNum( 21.1 ), 21 );
test( "GSUroundNum.8", GSUroundNum( 21.9 ), 22 );
test( "GSUroundNum.9", GSUroundNum( -21.9 ), -22 );
test( "GSUroundNum.a", GSUroundNum( -21.1 ), -21 );
test( "GSUroundNum.b", GSUroundNum( Math.PI, 1 ), 3.1 );
test( "GSUroundNum.c", GSUroundNum( Math.PI, 3 ), 3.142 );
test( "GSUroundNum.d", GSUroundNum( Math.PI, 6 ), 3.141593 );
test( "GSUuuid.0", GSUuuid().length, 36 );
test( "GSUsum.0", GSUsum( [] ), 0 );
test( "GSUsum.1", GSUsum( [ 7 ] ), 7 );
test( "GSUsum.2", GSUsum( [ 1, 2, 3, 4, 5, 6 ] ), 21 );
test( "GSUavg.0", GSUavg( [] ), 0 );
test( "GSUavg.1", GSUavg( [ -10, 15 ] ), 2.5 );
test( "GSUavg.2", GSUavg( [ 10, 20 ] ), 15 );
test( "GSUavg.3", GSUavg( [ 10, 20, 30 ] ), 20 );
test( "GSUstack.0", GSUsum( GSUstack( [ 5 ], 2 ) ), 2 );
test( "GSUstack.1", GSUsum( GSUstack( [ 2, 5 ], 7 ) ), 9 );
test( "GSUstack.2", GSUsum( GSUstack( [ 5, 7 ], 3 ) ), 8 );
test( "GSUstack.3", GSUsum( GSUstack( [ 1, 2, 3 ], 4 ) ), 7 );
test( "GSUuniqueName.0", GSUuniqueName( "foo", [] ), "foo" );
test( "GSUuniqueName.1", GSUuniqueName( "foo", [ "foo" ] ), "foo-2" );
test( "GSUuniqueName.2", GSUuniqueName( "foo", [ "foo", "foo-2" ] ), "foo-3" );
test( "GSUuniqueName.3", GSUuniqueName( "foo-2", [ "foo", "foo-2" ] ), "foo-3" );
test( "GSUuniqueName.4", GSUuniqueName( "foo-2", [ "foo", "foo-3" ] ), "foo-2" );
test( "GSUuniqueName.5", GSUuniqueName( "foo-2", [ "foo", "foo-3", "foo-2" ] ), "foo-4" );
test( "GSUuniqueName.6", GSUuniqueName( "foo-21-2", [ "foo", "foo-21-1", "foo-21-2" ] ), "foo-21-3" );
test( "GSUsplitSeconds.0", JSON.stringify( GSUsplitSeconds( 0 ) ), '{"m":"0","s":"00","ms":"000"}' );
test( "GSUsplitSeconds.1", JSON.stringify( GSUsplitSeconds( 21 ) ), '{"m":"0","s":"21","ms":"000"}' );
test( "GSUsplitSeconds.2", JSON.stringify( GSUsplitSeconds( 60 ) ), '{"m":"1","s":"00","ms":"000"}' );
test( "GSUsplitSeconds.3", JSON.stringify( GSUsplitSeconds( 71 ) ), '{"m":"1","s":"11","ms":"000"}' );
test( "GSUsplitSeconds.4", JSON.stringify( GSUsplitSeconds( 71.12345 ) ), '{"m":"1","s":"11","ms":"123"}' );
console.log( `${ testsPassed } / ${ tests }` );
</script>