Skip to content

Commit e8fd225

Browse files
author
Steve Thompson
committed
new commit
1 parent e6520c5 commit e8fd225

File tree

5 files changed

+64
-8
lines changed

5 files changed

+64
-8
lines changed

.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
# See http://help.github.com/ignore-files/ for more about ignoring files.
3+
4+
# compiled output
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
testem.log
34+
/typings
35+
36+
# e2e
37+
/e2e/*.js
38+
/e2e/*.map
39+
40+
# System Files
41+
.DS_Store
42+
Thumbs.db

.idea/workspace.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.npmignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
lib/
2+
.idea/
3+
tests.js

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
"keywords": [
1414
"is",
1515
"not",
16-
"number",
17-
"integer",
18-
"float",
16+
"string",
1917
"type-checking",
2018
"type",
2119
"check",

tests.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
"use strict";
22
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+
47
var strings = ['', ' ', ' ', '\n', '\r', '\\', '\'', '"', '`', '1', '0', '!@#$%^&*()'];
58
var nonStrings = [true, 1, 0.0001, [8, 9], {}, function (i) { return (i === 2); }, false, { prop: 1 }, ['hello']];
9+
610
// Test 1: This must return true each time to pass:
711
var results = [];
812
for (var i = 0; i < strings.length; ++i) {
9-
results.push(isString_notString_1.isString(strings[i]));
13+
results.push(isString(strings[i]));
1014
}
1115
if (results.length === strings.length && !(results.includes(undefined))
1216
&& !(results.includes(false)) && results.includes(true))
1317
console.log('test 1 passed');
1418
else
1519
console.log('test 1 FAILED');
20+
21+
1622
// Test 2: This must return false each time to pass:
1723
results = [];
1824
for (var i = 0; i < nonStrings.length; ++i) {
19-
results.push(isString_notString_1.isString(nonStrings[i]));
25+
results.push(isString(nonStrings[i]));
2026
}
2127
if (results.length === nonStrings.length && !(results.includes(undefined))
2228
&& !(results.includes(true)) && results.includes(false))
@@ -26,7 +32,7 @@ else
2632
// Test 3: This must return true each time to pass:
2733
results = [];
2834
for (var i = 0; i < nonStrings.length; ++i) {
29-
results.push(isString_notString_1.notString(nonStrings[i]));
35+
results.push(notString(nonStrings[i]));
3036
}
3137
if (results.length === nonStrings.length && !(results.includes(undefined))
3238
&& !(results.includes(false)) && results.includes(true))
@@ -36,7 +42,7 @@ else
3642
// Test 4: This must return false each time to pass:
3743
results = [];
3844
for (var i = 0; i < strings.length; ++i) {
39-
results.push(isString_notString_1.notString(strings[i]));
45+
results.push(notString(strings[i]));
4046
}
4147
if (results.length === strings.length && !(results.includes(undefined))
4248
&& !(results.includes(true)) && results.includes(false))

0 commit comments

Comments
 (0)