Skip to content

Commit 01d955d

Browse files
author
Steve Thompson
committed
updated package to be ECMAScript module
1 parent e8fd225 commit 01d955d

File tree

7 files changed

+182
-20
lines changed

7 files changed

+182
-20
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# IDEs and editors
1212
/.idea
13+
.idea/
1314
.project
1415
.classpath
1516
.c9/

.idea/workspace.xml

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

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright 2019 by Steve Thompson
3+
Copyright 2020 by Steve Thompson
44

55

66
Permission is hereby granted, free of charge, to any person obtaining

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# isString(arg): boolean
22

3-
Returns true if `arg` is of type 'string'.
3+
Returns true if `arg` is type 'string'.
44

55
# notString(arg): boolean
66

@@ -9,10 +9,6 @@ Returns true if `arg` is of type 'string'.
99
`npm i @writetome51/is-string-not-string`
1010

1111
## Loading
12-
```
13-
// if using TypeScript:
12+
```js
1413
import { isString, notString } from '@writetome51/is-string-not-string';
15-
// if using ES5 JavaScript:
16-
var isString = require('@writetome51/is-string-not-string').isString
17-
var notString = require('@writetome51/is-string-not-string').notString;
1814
```

index.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
"use strict";
2-
Object.defineProperty(exports, "__esModule", { value: true });
3-
4-
5-
function isString(arg) {
1+
export function isString(arg) {
62
return (typeof arg === 'string');
73
}
8-
exports.isString = isString;
94

105

11-
function notString(arg) {
6+
export function notString(arg) {
127
return !(isString(arg));
138
}
14-
exports.notString = notString;
9+

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "@writetome51/is-string-not-string",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "2 functions that check if argument is or is not string",
55
"main": "index.js",
6+
"type": "module",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"
89
},

tests.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
"use strict";
2-
Object.defineProperty(exports, "__esModule", { value: true });
3-
var isString = require("./index").isString;
4-
var notString = require("./index").notString;
1+
import {isString, notString} from './index.js';
52

63

74
var strings = ['', ' ', ' ', '\n', '\r', '\\', '\'', '"', '`', '1', '0', '!@#$%^&*()'];

0 commit comments

Comments
 (0)