@lijuhong1981/jscheck 1.0.4 → 1.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 +11 -0
- package/index.js +5 -4
- package/package.json +10 -13
- package/src/Check.js +3 -3
- package/src/getDefinedValue.js +10 -0
- package/src/isDefined.js +5 -0
- package/.gitattributes +0 -2
- package/src/defined.js +0 -5
- package/src/definedValue.js +0 -10
package/README.md
ADDED
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Check from "./src/Check.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import isDefined from "./src/isDefined.js";
|
|
3
|
+
import getDefinedValue from "./src/getDefinedValue.js";
|
|
4
4
|
import isArray from "./src/isArray.js";
|
|
5
5
|
import isBoolean from "./src/isBoolean.js";
|
|
6
6
|
import isFunction from "./src/isFunction.js";
|
|
@@ -14,8 +14,9 @@ import getValidValue from "./src/getValidValue.js";
|
|
|
14
14
|
|
|
15
15
|
export default Check;
|
|
16
16
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
Check,
|
|
18
|
+
isDefined,
|
|
19
|
+
getDefinedValue,
|
|
19
20
|
isArray,
|
|
20
21
|
isBoolean,
|
|
21
22
|
isFunction,
|
package/package.json
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lijuhong1981/jscheck",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "> TODO: description",
|
|
5
|
+
"author": "lijuhong1981",
|
|
6
|
+
"homepage": "https://github.com/lijuhong1981/jslib#readme",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"type": "module",
|
|
5
9
|
"main": "index.js",
|
|
6
10
|
"module": "index.js",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
|
-
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/lijuhong1981/
|
|
13
|
+
"url": "git+https://github.com/lijuhong1981/jslib.git"
|
|
14
14
|
},
|
|
15
|
-
"author": "lijuhong1981",
|
|
16
|
-
"license": "ISC",
|
|
17
15
|
"bugs": {
|
|
18
|
-
"url": "https://github.com/lijuhong1981/
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
16
|
+
"url": "https://github.com/lijuhong1981/jslib/issues"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/Check.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import isDefined from "./isDefined.js";
|
|
2
2
|
import isValid from "./isValid.js";
|
|
3
3
|
|
|
4
4
|
const Check = {};
|
|
@@ -25,12 +25,12 @@ function getFailedTypeErrorMessage(actual, expected, name) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
Check.defined = function (name, test) {
|
|
28
|
-
if (!
|
|
28
|
+
if (!isDefined(test)) {
|
|
29
29
|
throw new Error(getUndefinedErrorMessage(name));
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
Check.
|
|
33
|
+
Check.valid = function (name, test) {
|
|
34
34
|
if (!isValid(test)) {
|
|
35
35
|
throw new Error(getInvalidErrorMessage(name));
|
|
36
36
|
}
|
package/src/isDefined.js
ADDED
package/.gitattributes
DELETED
package/src/defined.js
DELETED