wrangler 0.0.2 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -55
- package/bin/wrangler.js +36 -0
- package/import_meta_url.js +3 -0
- package/miniflare-config-stubs/.env.empty +0 -0
- package/miniflare-config-stubs/package.empty.json +1 -0
- package/miniflare-config-stubs/wrangler.empty.toml +0 -0
- package/package.json +111 -9
- package/src/__tests__/clipboardy-mock.js +4 -0
- package/src/__tests__/index.test.ts +391 -0
- package/src/__tests__/jest.setup.ts +17 -0
- package/src/__tests__/mock-cfetch.js +42 -0
- package/src/__tests__/mock-dialogs.ts +65 -0
- package/src/api/form_data.ts +141 -0
- package/src/api/inspect.ts +430 -0
- package/src/api/preview.ts +128 -0
- package/src/api/worker.ts +161 -0
- package/src/cfetch.ts +72 -0
- package/src/cli.ts +10 -0
- package/src/config.ts +122 -0
- package/src/dev.tsx +867 -0
- package/src/dialogs.tsx +77 -0
- package/src/index.tsx +1875 -0
- package/src/kv.tsx +211 -0
- package/src/module-collection.ts +64 -0
- package/src/pages.tsx +818 -0
- package/src/proxy.ts +104 -0
- package/src/publish.ts +358 -0
- package/src/sites.tsx +115 -0
- package/src/tail.tsx +71 -0
- package/src/user.tsx +1029 -0
- package/static-asset-facade.js +47 -0
- package/vendor/@cloudflare/kv-asset-handler/CHANGELOG.md +332 -0
- package/vendor/@cloudflare/kv-asset-handler/LICENSE_APACHE +176 -0
- package/vendor/@cloudflare/kv-asset-handler/LICENSE_MIT +25 -0
- package/vendor/@cloudflare/kv-asset-handler/README.md +245 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/index.d.ts +32 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/index.js +354 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/mocks.d.ts +13 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/mocks.js +148 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/test/getAssetFromKV.d.ts +1 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/test/getAssetFromKV.js +436 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/test/mapRequestToAsset.d.ts +1 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/test/mapRequestToAsset.js +40 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/test/serveSinglePageApp.d.ts +1 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/test/serveSinglePageApp.js +42 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/types.d.ts +26 -0
- package/vendor/@cloudflare/kv-asset-handler/dist/types.js +31 -0
- package/vendor/@cloudflare/kv-asset-handler/package.json +52 -0
- package/vendor/@cloudflare/kv-asset-handler/src/index.ts +296 -0
- package/vendor/@cloudflare/kv-asset-handler/src/mocks.ts +136 -0
- package/vendor/@cloudflare/kv-asset-handler/src/test/getAssetFromKV.ts +464 -0
- package/vendor/@cloudflare/kv-asset-handler/src/test/mapRequestToAsset.ts +33 -0
- package/vendor/@cloudflare/kv-asset-handler/src/test/serveSinglePageApp.ts +42 -0
- package/vendor/@cloudflare/kv-asset-handler/src/types.ts +39 -0
- package/vendor/wrangler-mime/CHANGELOG.md +289 -0
- package/vendor/wrangler-mime/LICENSE +21 -0
- package/vendor/wrangler-mime/Mime.js +97 -0
- package/vendor/wrangler-mime/README.md +187 -0
- package/vendor/wrangler-mime/cli.js +46 -0
- package/vendor/wrangler-mime/index.js +4 -0
- package/vendor/wrangler-mime/lite.js +4 -0
- package/vendor/wrangler-mime/package.json +52 -0
- package/vendor/wrangler-mime/types/other.js +1 -0
- package/vendor/wrangler-mime/types/standard.js +1 -0
- package/wrangler-dist/cli.js +125758 -0
- package/wrangler-dist/cli.js.map +7 -0
- package/.npmignore +0 -15
- package/index.js +0 -250
- package/tests/is.spec.js +0 -1155
package/tests/is.spec.js
DELETED
|
@@ -1,1155 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Paul d'Aoust
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
var is = require('../index').is;
|
|
6
|
-
|
|
7
|
-
describe('is', function () {
|
|
8
|
-
var testValues = {
|
|
9
|
-
integer: 1,
|
|
10
|
-
decimal: 1.5,
|
|
11
|
-
zero: 0,
|
|
12
|
-
stringInteger: '1',
|
|
13
|
-
stringDecimal: '2.5',
|
|
14
|
-
string: 'hello',
|
|
15
|
-
array: [0, 1, 2, 1.5, '3', '2.5', 'hello', null, true, false, NaN, {}, [], [1, 2, 3]],
|
|
16
|
-
object: { },
|
|
17
|
-
regexp: /hello/,
|
|
18
|
-
function: function () { },
|
|
19
|
-
nan: NaN,
|
|
20
|
-
boolean: true,
|
|
21
|
-
'null': null
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// is.undefined
|
|
25
|
-
it('should not recognise 1 as undefined', function () {
|
|
26
|
-
var result = is.undefined(testValues.integer);
|
|
27
|
-
expect(result).toBe(false);
|
|
28
|
-
});
|
|
29
|
-
it('should not recognise 1.5 as undefined', function () {
|
|
30
|
-
var result = is.undefined(testValues.decimal);
|
|
31
|
-
expect(result).toBe(false);
|
|
32
|
-
});
|
|
33
|
-
it('should not recognise 0 as undefined', function () {
|
|
34
|
-
var result = is.undefined(testValues.zero);
|
|
35
|
-
expect(result).toBe(false);
|
|
36
|
-
});
|
|
37
|
-
it('should not recognise \'1\' as undefined', function () {
|
|
38
|
-
var result = is.undefined(testValues.stringInteger);
|
|
39
|
-
expect(result).toBe(false);
|
|
40
|
-
});
|
|
41
|
-
it('should not recognise \'1.5\' as undefined', function () {
|
|
42
|
-
var result = is.undefined(testValues.stringDecimal);
|
|
43
|
-
expect(result).toBe(false);
|
|
44
|
-
});
|
|
45
|
-
it('should not recognise \'hello\' as undefined', function () {
|
|
46
|
-
var result = is.undefined(testValues.string);
|
|
47
|
-
expect(result).toBe(false);
|
|
48
|
-
});
|
|
49
|
-
it('should not recognise an array as undefined', function () {
|
|
50
|
-
var result = is.undefined(testValues.array);
|
|
51
|
-
expect(result).toBe(false);
|
|
52
|
-
});
|
|
53
|
-
it('should not recognise {} as undefined', function () {
|
|
54
|
-
var result = is.undefined(testValues.object);
|
|
55
|
-
expect(result).toBe(false);
|
|
56
|
-
});
|
|
57
|
-
it('should not recognise /hello/ as undefined', function () {
|
|
58
|
-
var result = is.undefined(testValues.regexp);
|
|
59
|
-
expect(result).toBe(false);
|
|
60
|
-
});
|
|
61
|
-
it('should not recognise a function as undefined', function () {
|
|
62
|
-
var result = is.undefined(testValues.function);
|
|
63
|
-
expect(result).toBe(false);
|
|
64
|
-
});
|
|
65
|
-
it('should not recognise NaN as undefined', function () {
|
|
66
|
-
var result = is.undefined(testValues.nan);
|
|
67
|
-
expect(result).toBe(false);
|
|
68
|
-
});
|
|
69
|
-
it('should not recognise true as undefined', function () {
|
|
70
|
-
var result = is.undefined(testValues.boolean);
|
|
71
|
-
expect(result).toBe(false);
|
|
72
|
-
});
|
|
73
|
-
it('should not recognise null as undefined', function () {
|
|
74
|
-
var result = is.undefined(testValues.null);
|
|
75
|
-
expect(result).toBe(false);
|
|
76
|
-
});
|
|
77
|
-
it('should recognise an undefinedined value as undefined', function () {
|
|
78
|
-
var result = is.undefined(testValues.undefined);
|
|
79
|
-
expect(result).toBe(true);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// is.empty
|
|
83
|
-
it('should not recognise 1 as empty', function () {
|
|
84
|
-
var result = is.empty(testValues.integer);
|
|
85
|
-
expect(result).toBe(false);
|
|
86
|
-
});
|
|
87
|
-
it('should not recognise 1.5 as empty', function () {
|
|
88
|
-
var result = is.empty(testValues.decimal);
|
|
89
|
-
expect(result).toBe(false);
|
|
90
|
-
});
|
|
91
|
-
it('should not recognise 0 as empty', function () {
|
|
92
|
-
var result = is.empty(testValues.zero);
|
|
93
|
-
expect(result).toBe(false);
|
|
94
|
-
});
|
|
95
|
-
it('should not recognise \'1\' as empty', function () {
|
|
96
|
-
var result = is.empty(testValues.stringInteger);
|
|
97
|
-
expect(result).toBe(false);
|
|
98
|
-
});
|
|
99
|
-
it('should not recognise \'1.5\' as empty', function () {
|
|
100
|
-
var result = is.empty(testValues.stringDecimal);
|
|
101
|
-
expect(result).toBe(false);
|
|
102
|
-
});
|
|
103
|
-
it('should not recognise \'hello\' as empty', function () {
|
|
104
|
-
var result = is.empty(testValues.string);
|
|
105
|
-
expect(result).toBe(false);
|
|
106
|
-
});
|
|
107
|
-
it('should not recognise an array as empty', function () {
|
|
108
|
-
var result = is.empty(testValues.array);
|
|
109
|
-
expect(result).toBe(false);
|
|
110
|
-
});
|
|
111
|
-
it('should not recognise {} as empty', function () {
|
|
112
|
-
var result = is.empty(testValues.object);
|
|
113
|
-
expect(result).toBe(false);
|
|
114
|
-
});
|
|
115
|
-
it('should not recognise /hello/ as empty', function () {
|
|
116
|
-
var result = is.empty(testValues.regexp);
|
|
117
|
-
expect(result).toBe(false);
|
|
118
|
-
});
|
|
119
|
-
it('should not recognise a function as empty', function () {
|
|
120
|
-
var result = is.empty(testValues.function);
|
|
121
|
-
expect(result).toBe(false);
|
|
122
|
-
});
|
|
123
|
-
it('should not recognise NaN as empty', function () {
|
|
124
|
-
var result = is.empty(testValues.nan);
|
|
125
|
-
expect(result).toBe(false);
|
|
126
|
-
});
|
|
127
|
-
it('should not recognise true as empty', function () {
|
|
128
|
-
var result = is.empty(testValues.boolean);
|
|
129
|
-
expect(result).toBe(false);
|
|
130
|
-
});
|
|
131
|
-
it('should recognise null as empty', function () {
|
|
132
|
-
var result = is.empty(testValues.null);
|
|
133
|
-
expect(result).toBe(true);
|
|
134
|
-
});
|
|
135
|
-
it('should recognise an undefinedined value as empty', function () {
|
|
136
|
-
var result = is.empty(testValues.undefined);
|
|
137
|
-
expect(result).toBe(true);
|
|
138
|
-
});
|
|
139
|
-
it('should not recognise [] as empty', function () {
|
|
140
|
-
var result = is.empty([]);
|
|
141
|
-
expect(result).toBe(false);
|
|
142
|
-
});
|
|
143
|
-
it('should not recognise {} as empty', function () {
|
|
144
|
-
var result = is.empty({});
|
|
145
|
-
expect(result).toBe(false);
|
|
146
|
-
});
|
|
147
|
-
it('should recognise [] as empty array', function () {
|
|
148
|
-
var result = is.empty.array([]);
|
|
149
|
-
expect(result).toBe(true);
|
|
150
|
-
});
|
|
151
|
-
it('should not recognise array as empty array', function () {
|
|
152
|
-
var result = is.empty.array(testValues.array);
|
|
153
|
-
expect(result).toBe(false);
|
|
154
|
-
});
|
|
155
|
-
it('should not recognise {} as empty array', function () {
|
|
156
|
-
var result = is.empty.array({});
|
|
157
|
-
expect(result).toBe(false);
|
|
158
|
-
});
|
|
159
|
-
it('should recognise {} as empty object', function () {
|
|
160
|
-
var result = is.empty.object({});
|
|
161
|
-
expect(result).toBe(true);
|
|
162
|
-
});
|
|
163
|
-
it('should not recognise testValues as empty object', function () {
|
|
164
|
-
var result = is.empty.object(testValues);
|
|
165
|
-
expect(result).toBe(false);
|
|
166
|
-
});
|
|
167
|
-
it('should not recognise [] as empty object', function () {
|
|
168
|
-
var result = is.empty.object([]);
|
|
169
|
-
expect(result).toBeFalsy();
|
|
170
|
-
});
|
|
171
|
-
it('should recognise args as empty arguments', function () {
|
|
172
|
-
(function () {
|
|
173
|
-
var result = is.empty.array(arguments);
|
|
174
|
-
expect(result).toBe(true);
|
|
175
|
-
})();
|
|
176
|
-
});
|
|
177
|
-
it('should not recognise args as empty arguments', function () {
|
|
178
|
-
(function () {
|
|
179
|
-
var result = is.empty.array(arguments);
|
|
180
|
-
expect(result).toBe(false);
|
|
181
|
-
})(testValues.string, testValues.zero);
|
|
182
|
-
});
|
|
183
|
-
it('should not recognise args as empty object', function () {
|
|
184
|
-
(function () {
|
|
185
|
-
var result = is.empty.object(arguments);
|
|
186
|
-
expect(result).toBeFalsy();
|
|
187
|
-
})(testValues.string, testValues.zero);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
// is.null
|
|
191
|
-
it('should not recognise 1 as null', function () {
|
|
192
|
-
var result = is.null(testValues.integer);
|
|
193
|
-
expect(result).toBe(false);
|
|
194
|
-
});
|
|
195
|
-
it('should not recognise 1.5 as null', function () {
|
|
196
|
-
var result = is.null(testValues.decimal);
|
|
197
|
-
expect(result).toBe(false);
|
|
198
|
-
});
|
|
199
|
-
it('should not recognise 0 as null', function () {
|
|
200
|
-
var result = is.null(testValues.zero);
|
|
201
|
-
expect(result).toBe(false);
|
|
202
|
-
});
|
|
203
|
-
it('should not recognise \'1\' as null', function () {
|
|
204
|
-
var result = is.null(testValues.stringInteger);
|
|
205
|
-
expect(result).toBe(false);
|
|
206
|
-
});
|
|
207
|
-
it('should not recognise \'1.5\' as null', function () {
|
|
208
|
-
var result = is.null(testValues.stringDecimal);
|
|
209
|
-
expect(result).toBe(false);
|
|
210
|
-
});
|
|
211
|
-
it('should not recognise \'hello\' as null', function () {
|
|
212
|
-
var result = is.null(testValues.string);
|
|
213
|
-
expect(result).toBe(false);
|
|
214
|
-
});
|
|
215
|
-
it('should not recognise an array as null', function () {
|
|
216
|
-
var result = is.null(testValues.array);
|
|
217
|
-
expect(result).toBe(false);
|
|
218
|
-
});
|
|
219
|
-
it('should not recognise {} as null', function () {
|
|
220
|
-
var result = is.null(testValues.object);
|
|
221
|
-
expect(result).toBe(false);
|
|
222
|
-
});
|
|
223
|
-
it('should not recognise /hello/ as null', function () {
|
|
224
|
-
var result = is.null(testValues.regexp);
|
|
225
|
-
expect(result).toBe(false);
|
|
226
|
-
});
|
|
227
|
-
it('should not recognise a function as null', function () {
|
|
228
|
-
var result = is.null(testValues.function);
|
|
229
|
-
expect(result).toBe(false);
|
|
230
|
-
});
|
|
231
|
-
it('should not recognise NaN as null', function () {
|
|
232
|
-
var result = is.null(testValues.nan);
|
|
233
|
-
expect(result).toBe(false);
|
|
234
|
-
});
|
|
235
|
-
it('should not recognise true as null', function () {
|
|
236
|
-
var result = is.null(testValues.boolean);
|
|
237
|
-
expect(result).toBe(false);
|
|
238
|
-
});
|
|
239
|
-
it('should recognise null as null', function () {
|
|
240
|
-
var result = is.null(testValues.null);
|
|
241
|
-
expect(result).toBe(true);
|
|
242
|
-
});
|
|
243
|
-
it('should not recognise an undefinedined value as null', function () {
|
|
244
|
-
var result = is.null(testValues.undefined);
|
|
245
|
-
expect(result).toBe(false);
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
// is.boolean
|
|
249
|
-
it('should not recognise 1 as boolean', function () {
|
|
250
|
-
var result = is.boolean(testValues.integer);
|
|
251
|
-
expect(result).toBe(false);
|
|
252
|
-
});
|
|
253
|
-
it('should not recognise 1.5 as boolean', function () {
|
|
254
|
-
var result = is.boolean(testValues.decimal);
|
|
255
|
-
expect(result).toBe(false);
|
|
256
|
-
});
|
|
257
|
-
it('should not recognise 0 as boolean', function () {
|
|
258
|
-
var result = is.boolean(testValues.zero);
|
|
259
|
-
expect(result).toBe(false);
|
|
260
|
-
});
|
|
261
|
-
it('should not recognise \'1\' as boolean', function () {
|
|
262
|
-
var result = is.boolean(testValues.stringInteger);
|
|
263
|
-
expect(result).toBe(false);
|
|
264
|
-
});
|
|
265
|
-
it('should not recognise \'1.5\' as boolean', function () {
|
|
266
|
-
var result = is.boolean(testValues.stringDecimal);
|
|
267
|
-
expect(result).toBe(false);
|
|
268
|
-
});
|
|
269
|
-
it('should not recognise \'hello\' as boolean', function () {
|
|
270
|
-
var result = is.boolean(testValues.string);
|
|
271
|
-
expect(result).toBe(false);
|
|
272
|
-
});
|
|
273
|
-
it('should not recognise an array as boolean', function () {
|
|
274
|
-
var result = is.boolean(testValues.array);
|
|
275
|
-
expect(result).toBe(false);
|
|
276
|
-
});
|
|
277
|
-
it('should not recognise {} as boolean', function () {
|
|
278
|
-
var result = is.boolean(testValues.object);
|
|
279
|
-
expect(result).toBe(false);
|
|
280
|
-
});
|
|
281
|
-
it('should not recognise /hello/ as boolean', function () {
|
|
282
|
-
var result = is.boolean(testValues.regexp);
|
|
283
|
-
expect(result).toBe(false);
|
|
284
|
-
});
|
|
285
|
-
it('should not recognise a function as boolean', function () {
|
|
286
|
-
var result = is.boolean(testValues.function);
|
|
287
|
-
expect(result).toBe(false);
|
|
288
|
-
});
|
|
289
|
-
it('should not recognise NaN as boolean', function () {
|
|
290
|
-
var result = is.boolean(testValues.nan);
|
|
291
|
-
expect(result).toBe(false);
|
|
292
|
-
});
|
|
293
|
-
it('should recognise true as boolean', function () {
|
|
294
|
-
var result = is.boolean(testValues.boolean);
|
|
295
|
-
expect(result).toBe(true);
|
|
296
|
-
});
|
|
297
|
-
it('should not recognise null as boolean', function () {
|
|
298
|
-
var result = is.boolean(testValues.null);
|
|
299
|
-
expect(result).toBe(false);
|
|
300
|
-
});
|
|
301
|
-
it('should not recognise an undefinedined value as boolean', function () {
|
|
302
|
-
var result = is.boolean(testValues.undefined);
|
|
303
|
-
expect(result).toBe(false);
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
// is.nan
|
|
307
|
-
it('should not recognise 1 as NaN', function () {
|
|
308
|
-
var result = is.nan(testValues.integer);
|
|
309
|
-
expect(result).toBe(false);
|
|
310
|
-
});
|
|
311
|
-
it('should not recognise 1.5 as NaN', function () {
|
|
312
|
-
var result = is.nan(testValues.decimal);
|
|
313
|
-
expect(result).toBe(false);
|
|
314
|
-
});
|
|
315
|
-
it('should not recognise 0 as NaN', function () {
|
|
316
|
-
var result = is.nan(testValues.zero);
|
|
317
|
-
expect(result).toBe(false);
|
|
318
|
-
});
|
|
319
|
-
it('should not recognise \'1\' as NaN', function () {
|
|
320
|
-
var result = is.nan(testValues.stringInteger);
|
|
321
|
-
expect(result).toBe(false);
|
|
322
|
-
});
|
|
323
|
-
it('should not recognise \'1.5\' as NaN', function () {
|
|
324
|
-
var result = is.nan(testValues.stringDecimal);
|
|
325
|
-
expect(result).toBe(false);
|
|
326
|
-
});
|
|
327
|
-
it('should not recognise \'hello\' as NaN', function () {
|
|
328
|
-
var result = is.nan(testValues.string);
|
|
329
|
-
expect(result).toBe(false);
|
|
330
|
-
});
|
|
331
|
-
it('should recognise an array as NaN', function () {
|
|
332
|
-
var result = is.nan(testValues.array);
|
|
333
|
-
expect(result).toBe(false);
|
|
334
|
-
});
|
|
335
|
-
it('should not recognise {} as NaN', function () {
|
|
336
|
-
var result = is.nan(testValues.object);
|
|
337
|
-
expect(result).toBe(false);
|
|
338
|
-
});
|
|
339
|
-
it('should not recognise /hello/ as NaN', function () {
|
|
340
|
-
var result = is.nan(testValues.regexp);
|
|
341
|
-
expect(result).toBe(false);
|
|
342
|
-
});
|
|
343
|
-
it('should not recognise a function as NaN', function () {
|
|
344
|
-
var result = is.nan(testValues.function);
|
|
345
|
-
expect(result).toBe(false);
|
|
346
|
-
});
|
|
347
|
-
it('should recognise NaN as NaN', function () {
|
|
348
|
-
var result = is.nan(testValues.nan);
|
|
349
|
-
expect(result).toBe(true);
|
|
350
|
-
});
|
|
351
|
-
it('should not recognise true as NaN', function () {
|
|
352
|
-
var result = is.nan(testValues.boolean);
|
|
353
|
-
expect(result).toBe(false);
|
|
354
|
-
});
|
|
355
|
-
it('should not recognise null as NaN', function () {
|
|
356
|
-
var result = is.nan(testValues.null);
|
|
357
|
-
expect(result).toBe(false);
|
|
358
|
-
});
|
|
359
|
-
it('should not recognise an undefinedined value as NaN', function () {
|
|
360
|
-
var result = is.nan(testValues.undefined);
|
|
361
|
-
expect(result).toBe(false);
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
// is.number
|
|
365
|
-
it('should recognise 1 as number', function () {
|
|
366
|
-
var result = is.number(testValues.integer);
|
|
367
|
-
expect(result).toBe(true);
|
|
368
|
-
});
|
|
369
|
-
it('should recognise 1.5 as number', function () {
|
|
370
|
-
var result = is.number(testValues.decimal);
|
|
371
|
-
expect(result).toBe(true);
|
|
372
|
-
});
|
|
373
|
-
it('should recognise 0 as number', function () {
|
|
374
|
-
var result = is.number(testValues.zero);
|
|
375
|
-
expect(result).toBe(true);
|
|
376
|
-
});
|
|
377
|
-
it('should not recognise \'1\' as number', function () {
|
|
378
|
-
var result = is.number(testValues.stringInteger);
|
|
379
|
-
expect(result).toBe(false);
|
|
380
|
-
});
|
|
381
|
-
it('should not recognise \'1.5\' as number', function () {
|
|
382
|
-
var result = is.number(testValues.stringDecimal);
|
|
383
|
-
expect(result).toBe(false);
|
|
384
|
-
});
|
|
385
|
-
it('should not recognise \'hello\' as number', function () {
|
|
386
|
-
var result = is.number(testValues.string);
|
|
387
|
-
expect(result).toBe(false);
|
|
388
|
-
});
|
|
389
|
-
it('should not recognise an array as number', function () {
|
|
390
|
-
var result = is.number(testValues.array);
|
|
391
|
-
expect(result).toBe(false);
|
|
392
|
-
});
|
|
393
|
-
it('should not recognise {} as number', function () {
|
|
394
|
-
var result = is.number(testValues.object);
|
|
395
|
-
expect(result).toBe(false);
|
|
396
|
-
});
|
|
397
|
-
it('should not recognise /hello/ as number', function () {
|
|
398
|
-
var result = is.number(testValues.regexp);
|
|
399
|
-
expect(result).toBe(false);
|
|
400
|
-
});
|
|
401
|
-
it('should not recognise a function as number', function () {
|
|
402
|
-
var result = is.number(testValues.function);
|
|
403
|
-
expect(result).toBe(false);
|
|
404
|
-
});
|
|
405
|
-
it('should not recognise NaN as number', function () {
|
|
406
|
-
var result = is.number(testValues.nan);
|
|
407
|
-
expect(result).toBe(false);
|
|
408
|
-
});
|
|
409
|
-
it('should not recognise true as number', function () {
|
|
410
|
-
var result = is.number(testValues.boolean);
|
|
411
|
-
expect(result).toBe(false);
|
|
412
|
-
});
|
|
413
|
-
it('should not recognise null as number', function () {
|
|
414
|
-
var result = is.number(testValues.null);
|
|
415
|
-
expect(result).toBe(false);
|
|
416
|
-
});
|
|
417
|
-
it('should not recognise an undefinedined value as number', function () {
|
|
418
|
-
var result = is.number(testValues.undefined);
|
|
419
|
-
expect(result).toBe(false);
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
// is.integer
|
|
423
|
-
it('should recognise 1 as integer', function () {
|
|
424
|
-
var result = is.integer(testValues.integer);
|
|
425
|
-
expect(result).toBe(true);
|
|
426
|
-
});
|
|
427
|
-
it('should not recognise 1.5 as integer', function () {
|
|
428
|
-
var result = is.integer(testValues.decimal);
|
|
429
|
-
expect(result).toBe(false);
|
|
430
|
-
});
|
|
431
|
-
it('should recognise 0 as integer', function () {
|
|
432
|
-
var result = is.integer(testValues.zero);
|
|
433
|
-
expect(result).toBe(true);
|
|
434
|
-
});
|
|
435
|
-
it('should not recognise \'1\' as integer', function () {
|
|
436
|
-
var result = is.integer(testValues.stringInteger);
|
|
437
|
-
expect(result).toBe(false);
|
|
438
|
-
});
|
|
439
|
-
it('should not recognise \'1.5\' as integer', function () {
|
|
440
|
-
var result = is.integer(testValues.stringDecimal);
|
|
441
|
-
expect(result).toBe(false);
|
|
442
|
-
});
|
|
443
|
-
it('should not recognise \'hello\' as integer', function () {
|
|
444
|
-
var result = is.integer(testValues.string);
|
|
445
|
-
expect(result).toBe(false);
|
|
446
|
-
});
|
|
447
|
-
it('should not recognise an array as integer', function () {
|
|
448
|
-
var result = is.integer(testValues.array);
|
|
449
|
-
expect(result).toBe(false);
|
|
450
|
-
});
|
|
451
|
-
it('should not recognise {} as integer', function () {
|
|
452
|
-
var result = is.integer(testValues.object);
|
|
453
|
-
expect(result).toBe(false);
|
|
454
|
-
});
|
|
455
|
-
it('should not recognise /hello/ as integer', function () {
|
|
456
|
-
var result = is.integer(testValues.regexp);
|
|
457
|
-
expect(result).toBe(false);
|
|
458
|
-
});
|
|
459
|
-
it('should not recognise a function as integer', function () {
|
|
460
|
-
var result = is.integer(testValues.function);
|
|
461
|
-
expect(result).toBe(false);
|
|
462
|
-
});
|
|
463
|
-
it('should not recognise NaN as integer', function () {
|
|
464
|
-
var result = is.integer(testValues.nan);
|
|
465
|
-
expect(result).toBe(false);
|
|
466
|
-
});
|
|
467
|
-
it('should not recognise true as integer', function () {
|
|
468
|
-
var result = is.integer(testValues.boolean);
|
|
469
|
-
expect(result).toBe(false);
|
|
470
|
-
});
|
|
471
|
-
it('should not recognise null as integer', function () {
|
|
472
|
-
var result = is.integer(testValues.null);
|
|
473
|
-
expect(result).toBe(false);
|
|
474
|
-
});
|
|
475
|
-
it('should not recognise an undefinedined value as integer', function () {
|
|
476
|
-
var result = is.integer(testValues.undefined);
|
|
477
|
-
expect(result).toBe(false);
|
|
478
|
-
});
|
|
479
|
-
|
|
480
|
-
// is.float
|
|
481
|
-
it('should not recognise 1 as float', function () {
|
|
482
|
-
var result = is.float(testValues.integer);
|
|
483
|
-
expect(result).toBe(false);
|
|
484
|
-
});
|
|
485
|
-
it('should recognise 1.5 as float', function () {
|
|
486
|
-
var result = is.float(testValues.decimal);
|
|
487
|
-
expect(result).toBe(true);
|
|
488
|
-
});
|
|
489
|
-
it('should not recognise 0 as float', function () {
|
|
490
|
-
var result = is.float(testValues.zero);
|
|
491
|
-
expect(result).toBe(false);
|
|
492
|
-
});
|
|
493
|
-
it('should not recognise \'1\' as float', function () {
|
|
494
|
-
var result = is.float(testValues.stringInteger);
|
|
495
|
-
expect(result).toBe(false);
|
|
496
|
-
});
|
|
497
|
-
it('should not recognise \'1.5\' as float', function () {
|
|
498
|
-
var result = is.float(testValues.stringDecimal);
|
|
499
|
-
expect(result).toBe(false);
|
|
500
|
-
});
|
|
501
|
-
it('should not recognise \'hello\' as float', function () {
|
|
502
|
-
var result = is.float(testValues.string);
|
|
503
|
-
expect(result).toBe(false);
|
|
504
|
-
});
|
|
505
|
-
it('should not recognise an array as float', function () {
|
|
506
|
-
var result = is.float(testValues.array);
|
|
507
|
-
expect(result).toBe(false);
|
|
508
|
-
});
|
|
509
|
-
it('should not recognise {} as float', function () {
|
|
510
|
-
var result = is.float(testValues.object);
|
|
511
|
-
expect(result).toBe(false);
|
|
512
|
-
});
|
|
513
|
-
it('should not recognise /hello/ as float', function () {
|
|
514
|
-
var result = is.float(testValues.regexp);
|
|
515
|
-
expect(result).toBe(false);
|
|
516
|
-
});
|
|
517
|
-
it('should not recognise a function as float', function () {
|
|
518
|
-
var result = is.float(testValues.function);
|
|
519
|
-
expect(result).toBe(false);
|
|
520
|
-
});
|
|
521
|
-
it('should not recognise NaN as float', function () {
|
|
522
|
-
var result = is.float(testValues.nan);
|
|
523
|
-
expect(result).toBe(false);
|
|
524
|
-
});
|
|
525
|
-
it('should not recognise true as float', function () {
|
|
526
|
-
var result = is.float(testValues.boolean);
|
|
527
|
-
expect(result).toBe(false);
|
|
528
|
-
});
|
|
529
|
-
it('should not recognise null as float', function () {
|
|
530
|
-
var result = is.float(testValues.null);
|
|
531
|
-
expect(result).toBe(false);
|
|
532
|
-
});
|
|
533
|
-
it('should not recognise an undefinedined value as float', function () {
|
|
534
|
-
var result = is.float(testValues.undefined);
|
|
535
|
-
expect(result).toBe(false);
|
|
536
|
-
});
|
|
537
|
-
|
|
538
|
-
// is.string
|
|
539
|
-
it('should not recognise 1 as string', function () {
|
|
540
|
-
var result = is.string(testValues.integer);
|
|
541
|
-
expect(result).toBe(false);
|
|
542
|
-
});
|
|
543
|
-
it('should not recognise 1.5 as string', function () {
|
|
544
|
-
var result = is.string(testValues.decimal);
|
|
545
|
-
expect(result).toBe(false);
|
|
546
|
-
});
|
|
547
|
-
it('should not recognise 0 as string', function () {
|
|
548
|
-
var result = is.string(testValues.zero);
|
|
549
|
-
expect(result).toBe(false);
|
|
550
|
-
});
|
|
551
|
-
it('should recognise \'1\' as string', function () {
|
|
552
|
-
var result = is.string(testValues.stringInteger);
|
|
553
|
-
expect(result).toBe(true);
|
|
554
|
-
});
|
|
555
|
-
it('should recognise \'1.5\' as string', function () {
|
|
556
|
-
var result = is.string(testValues.stringDecimal);
|
|
557
|
-
expect(result).toBe(true);
|
|
558
|
-
});
|
|
559
|
-
it('should recognise \'hello\' as string', function () {
|
|
560
|
-
var result = is.string(testValues.string);
|
|
561
|
-
expect(result).toBe(true);
|
|
562
|
-
});
|
|
563
|
-
it('should not recognise an array as string', function () {
|
|
564
|
-
var result = is.string(testValues.array);
|
|
565
|
-
expect(result).toBe(false);
|
|
566
|
-
});
|
|
567
|
-
it('should not recognise {} as string', function () {
|
|
568
|
-
var result = is.string(testValues.object);
|
|
569
|
-
expect(result).toBe(false);
|
|
570
|
-
});
|
|
571
|
-
it('should not recognise /hello/ as string', function () {
|
|
572
|
-
var result = is.string(testValues.regexp);
|
|
573
|
-
expect(result).toBe(false);
|
|
574
|
-
});
|
|
575
|
-
it('should not recognise a function as string', function () {
|
|
576
|
-
var result = is.string(testValues.function);
|
|
577
|
-
expect(result).toBe(false);
|
|
578
|
-
});
|
|
579
|
-
it('should not recognise NaN as string', function () {
|
|
580
|
-
var result = is.string(testValues.nan);
|
|
581
|
-
expect(result).toBe(false);
|
|
582
|
-
});
|
|
583
|
-
it('should not recognise true as string', function () {
|
|
584
|
-
var result = is.string(testValues.boolean);
|
|
585
|
-
expect(result).toBe(false);
|
|
586
|
-
});
|
|
587
|
-
it('should not recognise null as string', function () {
|
|
588
|
-
var result = is.string(testValues.null);
|
|
589
|
-
expect(result).toBe(false);
|
|
590
|
-
});
|
|
591
|
-
it('should not recognise an undefinedined value as string', function () {
|
|
592
|
-
var result = is.string(testValues.undefined);
|
|
593
|
-
expect(result).toBe(false);
|
|
594
|
-
});
|
|
595
|
-
|
|
596
|
-
// is.object
|
|
597
|
-
it('should not recognise 1 as object', function () {
|
|
598
|
-
var result = is.object(testValues.integer);
|
|
599
|
-
expect(result).toBe(false);
|
|
600
|
-
});
|
|
601
|
-
it('should not recognise 1.5 as object', function () {
|
|
602
|
-
var result = is.object(testValues.decimal);
|
|
603
|
-
expect(result).toBe(false);
|
|
604
|
-
});
|
|
605
|
-
it('should not recognise 0 as object', function () {
|
|
606
|
-
var result = is.object(testValues.zero);
|
|
607
|
-
expect(result).toBe(false);
|
|
608
|
-
});
|
|
609
|
-
it('should not recognise \'1\' as object', function () {
|
|
610
|
-
var result = is.object(testValues.stringInteger);
|
|
611
|
-
expect(result).toBe(false);
|
|
612
|
-
});
|
|
613
|
-
it('should not recognise \'1.5\' as object', function () {
|
|
614
|
-
var result = is.object(testValues.stringDecimal);
|
|
615
|
-
expect(result).toBe(false);
|
|
616
|
-
});
|
|
617
|
-
it('should not recognise \'hello\' as object', function () {
|
|
618
|
-
var result = is.object(testValues.string);
|
|
619
|
-
expect(result).toBe(false);
|
|
620
|
-
});
|
|
621
|
-
it('should not recognise an array as object', function () {
|
|
622
|
-
var result = is.object(testValues.array);
|
|
623
|
-
expect(result).toBe(false);
|
|
624
|
-
});
|
|
625
|
-
it('should not recognise an args array as object', function () {
|
|
626
|
-
(function () {
|
|
627
|
-
var result = is.object(arguments);
|
|
628
|
-
expect(result).toBe(false);
|
|
629
|
-
})(testValues.string, testValues.zero);
|
|
630
|
-
});
|
|
631
|
-
it('should recognise {} as object', function () {
|
|
632
|
-
var result = is.object(testValues.object);
|
|
633
|
-
expect(result).toBe(true);
|
|
634
|
-
});
|
|
635
|
-
it('should not recognise /hello/ as object', function () {
|
|
636
|
-
var result = is.object(testValues.regexp);
|
|
637
|
-
expect(result).toBe(false);
|
|
638
|
-
});
|
|
639
|
-
it('should not recognise a function as object', function () {
|
|
640
|
-
var result = is.object(testValues.function);
|
|
641
|
-
expect(result).toBe(false);
|
|
642
|
-
});
|
|
643
|
-
it('should not recognise NaN as object', function () {
|
|
644
|
-
var result = is.object(testValues.nan);
|
|
645
|
-
expect(result).toBe(false);
|
|
646
|
-
});
|
|
647
|
-
it('should not recognise true as object', function () {
|
|
648
|
-
var result = is.object(testValues.boolean);
|
|
649
|
-
expect(result).toBe(false);
|
|
650
|
-
});
|
|
651
|
-
it('should not recognise null as object', function () {
|
|
652
|
-
var result = is.object(testValues.null);
|
|
653
|
-
expect(result).toBe(false);
|
|
654
|
-
});
|
|
655
|
-
it('should not recognise an undefinedined value as object', function () {
|
|
656
|
-
var result = is.object(testValues.undefined);
|
|
657
|
-
expect(result).toBe(false);
|
|
658
|
-
});
|
|
659
|
-
|
|
660
|
-
// is.array
|
|
661
|
-
it('should not recognise 1 as array', function () {
|
|
662
|
-
var result = is.array(testValues.integer);
|
|
663
|
-
expect(result).toBe(false);
|
|
664
|
-
});
|
|
665
|
-
it('should not recognise 1.5 as array', function () {
|
|
666
|
-
var result = is.array(testValues.decimal);
|
|
667
|
-
expect(result).toBe(false);
|
|
668
|
-
});
|
|
669
|
-
it('should not recognise 0 as array', function () {
|
|
670
|
-
var result = is.array(testValues.zero);
|
|
671
|
-
expect(result).toBe(false);
|
|
672
|
-
});
|
|
673
|
-
it('should not recognise \'1\' as array', function () {
|
|
674
|
-
var result = is.array(testValues.stringInteger);
|
|
675
|
-
expect(result).toBe(false);
|
|
676
|
-
});
|
|
677
|
-
it('should not recognise \'1.5\' as array', function () {
|
|
678
|
-
var result = is.array(testValues.stringDecimal);
|
|
679
|
-
expect(result).toBe(false);
|
|
680
|
-
});
|
|
681
|
-
it('should not recognise \'hello\' as array', function () {
|
|
682
|
-
var result = is.array(testValues.string);
|
|
683
|
-
expect(result).toBe(false);
|
|
684
|
-
});
|
|
685
|
-
it('should recognise an array as array', function () {
|
|
686
|
-
var result = is.array(testValues.array);
|
|
687
|
-
expect(result).toBe(true);
|
|
688
|
-
});
|
|
689
|
-
it('should not recognise an args array as array', function () {
|
|
690
|
-
(function () {
|
|
691
|
-
var result = is.array(arguments);
|
|
692
|
-
expect(result).toBe(false);
|
|
693
|
-
})(testValues.string, testValues.zero);
|
|
694
|
-
});
|
|
695
|
-
it('should not recognise {} as array', function () {
|
|
696
|
-
var result = is.array(testValues.object);
|
|
697
|
-
expect(result).toBe(false);
|
|
698
|
-
});
|
|
699
|
-
it('should not recognise /hello/ as array', function () {
|
|
700
|
-
var result = is.array(testValues.regexp);
|
|
701
|
-
expect(result).toBe(false);
|
|
702
|
-
});
|
|
703
|
-
it('should not recognise a function as array', function () {
|
|
704
|
-
var result = is.array(testValues.function);
|
|
705
|
-
expect(result).toBe(false);
|
|
706
|
-
});
|
|
707
|
-
it('should not recognise NaN as array', function () {
|
|
708
|
-
var result = is.array(testValues.nan);
|
|
709
|
-
expect(result).toBe(false);
|
|
710
|
-
});
|
|
711
|
-
it('should not recognise true as array', function () {
|
|
712
|
-
var result = is.array(testValues.boolean);
|
|
713
|
-
expect(result).toBe(false);
|
|
714
|
-
});
|
|
715
|
-
it('should not recognise null as array', function () {
|
|
716
|
-
var result = is.array(testValues.null);
|
|
717
|
-
expect(result).toBe(false);
|
|
718
|
-
});
|
|
719
|
-
it('should not recognise an undefinedined value as array', function () {
|
|
720
|
-
var result = is.array(testValues.undefined);
|
|
721
|
-
expect(result).toBe(false);
|
|
722
|
-
});
|
|
723
|
-
|
|
724
|
-
// is.enumerable
|
|
725
|
-
it('should not recognise 1 as enumerable', function () {
|
|
726
|
-
var result = is.enumerable(testValues.integer);
|
|
727
|
-
expect(result).toBe(false);
|
|
728
|
-
});
|
|
729
|
-
it('should not recognise 1.5 as enumerable', function () {
|
|
730
|
-
var result = is.enumerable(testValues.decimal);
|
|
731
|
-
expect(result).toBe(false);
|
|
732
|
-
});
|
|
733
|
-
it('should not recognise 0 as enumerable', function () {
|
|
734
|
-
var result = is.enumerable(testValues.zero);
|
|
735
|
-
expect(result).toBe(false);
|
|
736
|
-
});
|
|
737
|
-
it('should recognise \'1\' as enumerable', function () {
|
|
738
|
-
var result = is.enumerable(testValues.stringInteger);
|
|
739
|
-
expect(result).toBe(true);
|
|
740
|
-
});
|
|
741
|
-
it('should recognise \'1.5\' as enumerable', function () {
|
|
742
|
-
var result = is.enumerable(testValues.stringDecimal);
|
|
743
|
-
expect(result).toBe(true);
|
|
744
|
-
});
|
|
745
|
-
it('should recognise \'hello\' as enumerable', function () {
|
|
746
|
-
var result = is.enumerable(testValues.string);
|
|
747
|
-
expect(result).toBe(true);
|
|
748
|
-
});
|
|
749
|
-
it('should recognise an array as enumerable', function () {
|
|
750
|
-
var result = is.enumerable(testValues.array);
|
|
751
|
-
expect(result).toBe(true);
|
|
752
|
-
});
|
|
753
|
-
it('should recognise an args array as enumerable', function () {
|
|
754
|
-
(function () {
|
|
755
|
-
var result = is.enumerable(arguments);
|
|
756
|
-
expect(result).toBe(true);
|
|
757
|
-
})(testValues.string, testValues.zero);
|
|
758
|
-
});
|
|
759
|
-
it('should not recognise {} as enumerable', function () {
|
|
760
|
-
var result = is.enumerable(testValues.object);
|
|
761
|
-
expect(result).toBe(false);
|
|
762
|
-
});
|
|
763
|
-
it('should not recognise /hello/ as enumerable', function () {
|
|
764
|
-
var result = is.enumerable(testValues.regexp);
|
|
765
|
-
expect(result).toBe(false);
|
|
766
|
-
});
|
|
767
|
-
it('should not recognise a function as enumerable', function () {
|
|
768
|
-
var result = is.enumerable(testValues.function);
|
|
769
|
-
expect(result).toBe(false);
|
|
770
|
-
});
|
|
771
|
-
it('should not recognise NaN as enumerable', function () {
|
|
772
|
-
var result = is.enumerable(testValues.nan);
|
|
773
|
-
expect(result).toBe(false);
|
|
774
|
-
});
|
|
775
|
-
it('should not recognise true as enumerable', function () {
|
|
776
|
-
var result = is.enumerable(testValues.boolean);
|
|
777
|
-
expect(result).toBe(false);
|
|
778
|
-
});
|
|
779
|
-
it('should not recognise null as enumerable', function () {
|
|
780
|
-
var result = is.enumerable(testValues.null);
|
|
781
|
-
expect(result).toBe(false);
|
|
782
|
-
});
|
|
783
|
-
it('should not recognise an undefinedined value as enumerable', function () {
|
|
784
|
-
var result = is.enumerable(testValues.undefined);
|
|
785
|
-
expect(result).toBe(false);
|
|
786
|
-
});
|
|
787
|
-
|
|
788
|
-
// is.arrayLike
|
|
789
|
-
it('should not recognise 1 as arrayLike', function () {
|
|
790
|
-
var result = is.arrayLike(testValues.integer);
|
|
791
|
-
expect(result).toBe(false);
|
|
792
|
-
});
|
|
793
|
-
it('should not recognise 1.5 as arrayLike', function () {
|
|
794
|
-
var result = is.arrayLike(testValues.decimal);
|
|
795
|
-
expect(result).toBe(false);
|
|
796
|
-
});
|
|
797
|
-
it('should not recognise 0 as arrayLike', function () {
|
|
798
|
-
var result = is.arrayLike(testValues.zero);
|
|
799
|
-
expect(result).toBe(false);
|
|
800
|
-
});
|
|
801
|
-
it('should not recognise \'1\' as arrayLike', function () {
|
|
802
|
-
var result = is.arrayLike(testValues.stringInteger);
|
|
803
|
-
expect(result).toBe(false);
|
|
804
|
-
});
|
|
805
|
-
it('should not recognise \'1.5\' as arrayLike', function () {
|
|
806
|
-
var result = is.arrayLike(testValues.stringDecimal);
|
|
807
|
-
expect(result).toBe(false);
|
|
808
|
-
});
|
|
809
|
-
it('should not recognise \'hello\' as arrayLike', function () {
|
|
810
|
-
var result = is.arrayLike(testValues.string);
|
|
811
|
-
expect(result).toBe(false);
|
|
812
|
-
});
|
|
813
|
-
it('should not recognise an array as arrayLike', function () {
|
|
814
|
-
var result = is.arrayLike(testValues.array);
|
|
815
|
-
expect(result).toBeFalsy();
|
|
816
|
-
});
|
|
817
|
-
it('should recognise an args array as arrayLike', function () {
|
|
818
|
-
(function () {
|
|
819
|
-
var result = is.arrayLike(arguments);
|
|
820
|
-
expect(result).toBe(true);
|
|
821
|
-
})(testValues.string, testValues.zero);
|
|
822
|
-
});
|
|
823
|
-
it('should not recognise {} as arrayLike', function () {
|
|
824
|
-
var result = is.arrayLike(testValues.object);
|
|
825
|
-
expect(result).toBe(false);
|
|
826
|
-
});
|
|
827
|
-
it('should not recognise /hello/ as arrayLike', function () {
|
|
828
|
-
var result = is.arrayLike(testValues.regexp);
|
|
829
|
-
expect(result).toBe(false);
|
|
830
|
-
});
|
|
831
|
-
it('should not recognise a function as arrayLike', function () {
|
|
832
|
-
var result = is.arrayLike(testValues.function);
|
|
833
|
-
expect(result).toBe(false);
|
|
834
|
-
});
|
|
835
|
-
it('should not recognise NaN as arrayLike', function () {
|
|
836
|
-
var result = is.arrayLike(testValues.nan);
|
|
837
|
-
expect(result).toBe(false);
|
|
838
|
-
});
|
|
839
|
-
it('should not recognise true as arrayLike', function () {
|
|
840
|
-
var result = is.arrayLike(testValues.boolean);
|
|
841
|
-
expect(result).toBe(false);
|
|
842
|
-
});
|
|
843
|
-
it('should not recognise null as arrayLike', function () {
|
|
844
|
-
var result = is.arrayLike(testValues.null);
|
|
845
|
-
expect(result).toBe(false);
|
|
846
|
-
});
|
|
847
|
-
it('should not recognise an undefinedined value as arrayLike', function () {
|
|
848
|
-
var result = is.arrayLike(testValues.undefined);
|
|
849
|
-
expect(result).toBe(false);
|
|
850
|
-
});
|
|
851
|
-
|
|
852
|
-
// is.arguments
|
|
853
|
-
it('should not recognise 1 as arguments', function () {
|
|
854
|
-
var result = is.arguments(testValues.integer);
|
|
855
|
-
expect(result).toBe(false);
|
|
856
|
-
});
|
|
857
|
-
it('should not recognise 1.5 as arguments', function () {
|
|
858
|
-
var result = is.arguments(testValues.decimal);
|
|
859
|
-
expect(result).toBe(false);
|
|
860
|
-
});
|
|
861
|
-
it('should not recognise 0 as arguments', function () {
|
|
862
|
-
var result = is.arguments(testValues.zero);
|
|
863
|
-
expect(result).toBe(false);
|
|
864
|
-
});
|
|
865
|
-
it('should not recognise \'1\' as arguments', function () {
|
|
866
|
-
var result = is.arguments(testValues.stringInteger);
|
|
867
|
-
expect(result).toBe(false);
|
|
868
|
-
});
|
|
869
|
-
it('should not recognise \'1.5\' as arguments', function () {
|
|
870
|
-
var result = is.arguments(testValues.stringDecimal);
|
|
871
|
-
expect(result).toBe(false);
|
|
872
|
-
});
|
|
873
|
-
it('should not recognise \'hello\' as arguments', function () {
|
|
874
|
-
var result = is.arguments(testValues.string);
|
|
875
|
-
expect(result).toBe(false);
|
|
876
|
-
});
|
|
877
|
-
it('should recognise an array as array', function () {
|
|
878
|
-
var result = is.array(testValues.array);
|
|
879
|
-
expect(result).toBe(true);
|
|
880
|
-
});
|
|
881
|
-
it('should recognise an args array as arguments', function () {
|
|
882
|
-
(function () {
|
|
883
|
-
var result = is.arguments(arguments);
|
|
884
|
-
expect(result).toBe(true);
|
|
885
|
-
})(testValues.string, testValues.zero);
|
|
886
|
-
});
|
|
887
|
-
it('should not recognise {} as arguments', function () {
|
|
888
|
-
var result = is.arguments(testValues.object);
|
|
889
|
-
expect(result).toBe(false);
|
|
890
|
-
});
|
|
891
|
-
it('should not recognise /hello/ as arguments', function () {
|
|
892
|
-
var result = is.arguments(testValues.regexp);
|
|
893
|
-
expect(result).toBe(false);
|
|
894
|
-
});
|
|
895
|
-
it('should not recognise a function as arguments', function () {
|
|
896
|
-
var result = is.arguments(testValues.function);
|
|
897
|
-
expect(result).toBe(false);
|
|
898
|
-
});
|
|
899
|
-
it('should not recognise NaN as arguments', function () {
|
|
900
|
-
var result = is.arguments(testValues.nan);
|
|
901
|
-
expect(result).toBe(false);
|
|
902
|
-
});
|
|
903
|
-
it('should not recognise true as arguments', function () {
|
|
904
|
-
var result = is.arguments(testValues.boolean);
|
|
905
|
-
expect(result).toBe(false);
|
|
906
|
-
});
|
|
907
|
-
it('should not recognise null as arguments', function () {
|
|
908
|
-
var result = is.arguments(testValues.null);
|
|
909
|
-
expect(result).toBe(false);
|
|
910
|
-
});
|
|
911
|
-
it('should not recognise an undefinedined value as arguments', function () {
|
|
912
|
-
var result = is.arguments(testValues.undefined);
|
|
913
|
-
expect(result).toBe(false);
|
|
914
|
-
});
|
|
915
|
-
|
|
916
|
-
// is.function
|
|
917
|
-
it('should not recognise 1 as function', function () {
|
|
918
|
-
var result = is.function(testValues.integer);
|
|
919
|
-
expect(result).toBe(false);
|
|
920
|
-
});
|
|
921
|
-
it('should not recognise 1.5 as function', function () {
|
|
922
|
-
var result = is.function(testValues.decimal);
|
|
923
|
-
expect(result).toBe(false);
|
|
924
|
-
});
|
|
925
|
-
it('should not recognise 0 as function', function () {
|
|
926
|
-
var result = is.function(testValues.zero);
|
|
927
|
-
expect(result).toBe(false);
|
|
928
|
-
});
|
|
929
|
-
it('should not recognise \'1\' as function', function () {
|
|
930
|
-
var result = is.function(testValues.stringInteger);
|
|
931
|
-
expect(result).toBe(false);
|
|
932
|
-
});
|
|
933
|
-
it('should not recognise \'1.5\' as function', function () {
|
|
934
|
-
var result = is.function(testValues.stringDecimal);
|
|
935
|
-
expect(result).toBe(false);
|
|
936
|
-
});
|
|
937
|
-
it('should not recognise \'hello\' as function', function () {
|
|
938
|
-
var result = is.function(testValues.string);
|
|
939
|
-
expect(result).toBe(false);
|
|
940
|
-
});
|
|
941
|
-
it('should not recognise an array as function', function () {
|
|
942
|
-
var result = is.function(testValues.array);
|
|
943
|
-
expect(result).toBe(false);
|
|
944
|
-
});
|
|
945
|
-
it('should not recognise {} as function', function () {
|
|
946
|
-
var result = is.function(testValues.object);
|
|
947
|
-
expect(result).toBe(false);
|
|
948
|
-
});
|
|
949
|
-
it('should not recognise /hello/ as function', function () {
|
|
950
|
-
var result = is.function(testValues.regexp);
|
|
951
|
-
expect(result).toBe(false);
|
|
952
|
-
});
|
|
953
|
-
it('should recognise a function as function', function () {
|
|
954
|
-
var result = is.function(testValues.function);
|
|
955
|
-
expect(result).toBe(true);
|
|
956
|
-
});
|
|
957
|
-
it('should not recognise NaN as function', function () {
|
|
958
|
-
var result = is.function(testValues.nan);
|
|
959
|
-
expect(result).toBe(false);
|
|
960
|
-
});
|
|
961
|
-
it('should not recognise true as function', function () {
|
|
962
|
-
var result = is.function(testValues.boolean);
|
|
963
|
-
expect(result).toBe(false);
|
|
964
|
-
});
|
|
965
|
-
it('should not recognise null as function', function () {
|
|
966
|
-
var result = is.function(testValues.null);
|
|
967
|
-
expect(result).toBe(false);
|
|
968
|
-
});
|
|
969
|
-
it('should not recognise an undefinedined value as function', function () {
|
|
970
|
-
var result = is.function(testValues.undefined);
|
|
971
|
-
expect(result).toBe(false);
|
|
972
|
-
});
|
|
973
|
-
|
|
974
|
-
// is.regexp
|
|
975
|
-
it('should not recognise 1 as RegExp', function () {
|
|
976
|
-
var result = is.regexp(testValues.integer);
|
|
977
|
-
expect(result).toBe(false);
|
|
978
|
-
});
|
|
979
|
-
it('should not recognise 1.5 as RegExp', function () {
|
|
980
|
-
var result = is.regexp(testValues.decimal);
|
|
981
|
-
expect(result).toBe(false);
|
|
982
|
-
});
|
|
983
|
-
it('should not recognise 0 as RegExp', function () {
|
|
984
|
-
var result = is.regexp(testValues.zero);
|
|
985
|
-
expect(result).toBe(false);
|
|
986
|
-
});
|
|
987
|
-
it('should not recognise \'1\' as RegExp', function () {
|
|
988
|
-
var result = is.regexp(testValues.stringInteger);
|
|
989
|
-
expect(result).toBe(false);
|
|
990
|
-
});
|
|
991
|
-
it('should not recognise \'1.5\' as RegExp', function () {
|
|
992
|
-
var result = is.regexp(testValues.stringDecimal);
|
|
993
|
-
expect(result).toBe(false);
|
|
994
|
-
});
|
|
995
|
-
it('should not recognise \'hello\' as RegExp', function () {
|
|
996
|
-
var result = is.regexp(testValues.string);
|
|
997
|
-
expect(result).toBe(false);
|
|
998
|
-
});
|
|
999
|
-
it('should not recognise an array as RegExp', function () {
|
|
1000
|
-
var result = is.regexp(testValues.array);
|
|
1001
|
-
expect(result).toBe(false);
|
|
1002
|
-
});
|
|
1003
|
-
it('should not recognise {} as RegExp', function () {
|
|
1004
|
-
var result = is.regexp(testValues.object);
|
|
1005
|
-
expect(result).toBe(false);
|
|
1006
|
-
});
|
|
1007
|
-
it('should recognise /hello/ as RegExp', function () {
|
|
1008
|
-
var result = is.regexp(testValues.regexp);
|
|
1009
|
-
expect(result).toBe(true);
|
|
1010
|
-
});
|
|
1011
|
-
it('should not recognise a function as RegExp', function () {
|
|
1012
|
-
var result = is.regexp(testValues.function);
|
|
1013
|
-
expect(result).toBe(false);
|
|
1014
|
-
});
|
|
1015
|
-
it('should not recognise NaN as RegExp', function () {
|
|
1016
|
-
var result = is.regexp(testValues.nan);
|
|
1017
|
-
expect(result).toBe(false);
|
|
1018
|
-
});
|
|
1019
|
-
it('should not recognise true as RegExp', function () {
|
|
1020
|
-
var result = is.regexp(testValues.boolean);
|
|
1021
|
-
expect(result).toBe(false);
|
|
1022
|
-
});
|
|
1023
|
-
it('should not recognise null as RegExp', function () {
|
|
1024
|
-
var result = is.regexp(testValues.null);
|
|
1025
|
-
expect(result).toBe(false);
|
|
1026
|
-
});
|
|
1027
|
-
it('should not recognise an undefinedined value as RegExp', function () {
|
|
1028
|
-
var result = is.regexp(testValues.undefined);
|
|
1029
|
-
expect(result).toBe(false);
|
|
1030
|
-
});
|
|
1031
|
-
|
|
1032
|
-
// is.inArray
|
|
1033
|
-
it('should find 1 in array', function () {
|
|
1034
|
-
var result = is.inArray(1, testValues.array);
|
|
1035
|
-
expect(result).toBe(true);
|
|
1036
|
-
});
|
|
1037
|
-
it('should find 1.5 in array', function () {
|
|
1038
|
-
var result = is.inArray(1.5, testValues.array);
|
|
1039
|
-
expect(result).toBe(true);
|
|
1040
|
-
});
|
|
1041
|
-
it('should not find 2.5 in array', function () {
|
|
1042
|
-
var result = is.inArray(2.5, testValues.array);
|
|
1043
|
-
expect(result).toBe(false);
|
|
1044
|
-
});
|
|
1045
|
-
it('should find \'2.5\' in array', function () {
|
|
1046
|
-
var result = is.inArray('2.5', testValues.array);
|
|
1047
|
-
expect(result).toBe(true);
|
|
1048
|
-
});
|
|
1049
|
-
it('should find \'hello\' in array', function () {
|
|
1050
|
-
var result = is.inArray('hello', testValues.array);
|
|
1051
|
-
expect(result).toBe(true);
|
|
1052
|
-
});
|
|
1053
|
-
it('should find null in array', function () {
|
|
1054
|
-
var result = is.inArray(null, testValues.array);
|
|
1055
|
-
expect(result).toBe(true);
|
|
1056
|
-
});
|
|
1057
|
-
it('should find true in array', function () {
|
|
1058
|
-
var result = is.inArray(true, testValues.array);
|
|
1059
|
-
expect(result).toBe(true);
|
|
1060
|
-
});
|
|
1061
|
-
it('should find false in array', function () {
|
|
1062
|
-
var result = is.inArray(false, testValues.array);
|
|
1063
|
-
expect(result).toBe(true);
|
|
1064
|
-
});
|
|
1065
|
-
it('should not find NaN in array (to be compatible with indexOf())', function () {
|
|
1066
|
-
var result = is.inArray(NaN, testValues.array);
|
|
1067
|
-
expect(result).toBe(false);
|
|
1068
|
-
});
|
|
1069
|
-
it('should find null in array', function () {
|
|
1070
|
-
var result = is.inArray(null, testValues.array);
|
|
1071
|
-
expect(result).toBe(true);
|
|
1072
|
-
});
|
|
1073
|
-
it('should not find undefinedined in array', function () {
|
|
1074
|
-
var result = is.inArray(testValues.undefined, testValues.array);
|
|
1075
|
-
expect(result).toBe(false);
|
|
1076
|
-
});
|
|
1077
|
-
it('should not find an object literal in array', function () {
|
|
1078
|
-
var result = is.inArray({}, testValues.array);
|
|
1079
|
-
expect(result).toBe(false);
|
|
1080
|
-
});
|
|
1081
|
-
it('should not find an array literal in array', function () {
|
|
1082
|
-
var result = is.inArray([], testValues.array);
|
|
1083
|
-
expect(result).toBe(false);
|
|
1084
|
-
});
|
|
1085
|
-
it('should find the array\'s object literal in array', function () {
|
|
1086
|
-
var result = is.inArray(testValues.array[11], testValues.array);
|
|
1087
|
-
expect(result).toBe(true);
|
|
1088
|
-
});
|
|
1089
|
-
it('should find the array\'s empty array literal in array', function () {
|
|
1090
|
-
var result = is.inArray(testValues.array[12], testValues.array);
|
|
1091
|
-
expect(result).toBe(true);
|
|
1092
|
-
});
|
|
1093
|
-
|
|
1094
|
-
// is.inObject
|
|
1095
|
-
it('should find 1 in object', function () {
|
|
1096
|
-
var result = is.inObject(1, testValues);
|
|
1097
|
-
expect(result).toBe(true);
|
|
1098
|
-
});
|
|
1099
|
-
it('should find 1.5 in object', function () {
|
|
1100
|
-
var result = is.inObject(1.5, testValues);
|
|
1101
|
-
expect(result).toBe(true);
|
|
1102
|
-
});
|
|
1103
|
-
it('should not find 2.5 in object', function () {
|
|
1104
|
-
var result = is.inObject(2.5, testValues);
|
|
1105
|
-
expect(result).toBe(false);
|
|
1106
|
-
});
|
|
1107
|
-
it('should find \'2.5\' in object', function () {
|
|
1108
|
-
var result = is.inObject('2.5', testValues);
|
|
1109
|
-
expect(result).toBe(true);
|
|
1110
|
-
});
|
|
1111
|
-
it('should find \'hello\' in object', function () {
|
|
1112
|
-
var result = is.inObject('hello', testValues);
|
|
1113
|
-
expect(result).toBe(true);
|
|
1114
|
-
});
|
|
1115
|
-
it('should find null in object', function () {
|
|
1116
|
-
var result = is.inObject(null, testValues);
|
|
1117
|
-
expect(result).toBe(true);
|
|
1118
|
-
});
|
|
1119
|
-
it('should find true in object', function () {
|
|
1120
|
-
var result = is.inObject(true, testValues);
|
|
1121
|
-
expect(result).toBe(true);
|
|
1122
|
-
});
|
|
1123
|
-
it('should not find false in object', function () {
|
|
1124
|
-
var result = is.inObject(false, testValues);
|
|
1125
|
-
expect(result).toBe(false);
|
|
1126
|
-
});
|
|
1127
|
-
it('should not find NaN in object (to be compatible with indexOf())', function () {
|
|
1128
|
-
var result = is.inObject(NaN, testValues);
|
|
1129
|
-
expect(result).toBe(false);
|
|
1130
|
-
});
|
|
1131
|
-
it('should find null in object', function () {
|
|
1132
|
-
var result = is.inObject(null, testValues);
|
|
1133
|
-
expect(result).toBe(true);
|
|
1134
|
-
});
|
|
1135
|
-
it('should not find undefinedined in object', function () {
|
|
1136
|
-
var result = is.inObject(testValues.undefined, testValues);
|
|
1137
|
-
expect(result).toBe(false);
|
|
1138
|
-
});
|
|
1139
|
-
it('should not find an object literal in object', function () {
|
|
1140
|
-
var result = is.inObject({}, testValues);
|
|
1141
|
-
expect(result).toBe(false);
|
|
1142
|
-
});
|
|
1143
|
-
it('should not find an array literal in object', function () {
|
|
1144
|
-
var result = is.inObject([], testValues);
|
|
1145
|
-
expect(result).toBe(false);
|
|
1146
|
-
});
|
|
1147
|
-
it('should find the array\'s object literal in object', function () {
|
|
1148
|
-
var result = is.inObject(testValues.object, testValues);
|
|
1149
|
-
expect(result).toBe(true);
|
|
1150
|
-
});
|
|
1151
|
-
it('should find the array\'s empty array literal in object', function () {
|
|
1152
|
-
var result = is.inObject(testValues.array, testValues);
|
|
1153
|
-
expect(result).toBe(true);
|
|
1154
|
-
});
|
|
1155
|
-
});
|