|
1 | 1 | "use strict";
|
2 | 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 |
| -var isString_notString_1 = require("./index"); |
| 3 | +var isString = require("./index").isString; |
| 4 | +var notString = require("./index").notString; |
| 5 | + |
| 6 | + |
4 | 7 | var strings = ['', ' ', ' ', '\n', '\r', '\\', '\'', '"', '`', '1', '0', '!@#$%^&*()'];
|
5 | 8 | var nonStrings = [true, 1, 0.0001, [8, 9], {}, function (i) { return (i === 2); }, false, { prop: 1 }, ['hello']];
|
| 9 | + |
6 | 10 | // Test 1: This must return true each time to pass:
|
7 | 11 | var results = [];
|
8 | 12 | for (var i = 0; i < strings.length; ++i) {
|
9 |
| - results.push(isString_notString_1.isString(strings[i])); |
| 13 | + results.push(isString(strings[i])); |
10 | 14 | }
|
11 | 15 | if (results.length === strings.length && !(results.includes(undefined))
|
12 | 16 | && !(results.includes(false)) && results.includes(true))
|
13 | 17 | console.log('test 1 passed');
|
14 | 18 | else
|
15 | 19 | console.log('test 1 FAILED');
|
| 20 | + |
| 21 | + |
16 | 22 | // Test 2: This must return false each time to pass:
|
17 | 23 | results = [];
|
18 | 24 | for (var i = 0; i < nonStrings.length; ++i) {
|
19 |
| - results.push(isString_notString_1.isString(nonStrings[i])); |
| 25 | + results.push(isString(nonStrings[i])); |
20 | 26 | }
|
21 | 27 | if (results.length === nonStrings.length && !(results.includes(undefined))
|
22 | 28 | && !(results.includes(true)) && results.includes(false))
|
|
26 | 32 | // Test 3: This must return true each time to pass:
|
27 | 33 | results = [];
|
28 | 34 | for (var i = 0; i < nonStrings.length; ++i) {
|
29 |
| - results.push(isString_notString_1.notString(nonStrings[i])); |
| 35 | + results.push(notString(nonStrings[i])); |
30 | 36 | }
|
31 | 37 | if (results.length === nonStrings.length && !(results.includes(undefined))
|
32 | 38 | && !(results.includes(false)) && results.includes(true))
|
|
36 | 42 | // Test 4: This must return false each time to pass:
|
37 | 43 | results = [];
|
38 | 44 | for (var i = 0; i < strings.length; ++i) {
|
39 |
| - results.push(isString_notString_1.notString(strings[i])); |
| 45 | + results.push(notString(strings[i])); |
40 | 46 | }
|
41 | 47 | if (results.length === strings.length && !(results.includes(undefined))
|
42 | 48 | && !(results.includes(true)) && results.includes(false))
|
|
0 commit comments