@lijuhong1981/jscheck 1.0.3 → 1.0.4

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/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import Check from "./src/Check.js";
2
2
  import defined from "./src/defined.js";
3
+ import definedValue from "./src/definedValue.js";
3
4
  import isArray from "./src/isArray.js";
4
5
  import isBoolean from "./src/isBoolean.js";
5
6
  import isFunction from "./src/isFunction.js";
@@ -9,10 +10,12 @@ import isObject from "./src/isObject.js";
9
10
  import isString from "./src/isString.js";
10
11
  import isTypedArray from "./src/isTypedArray.js";
11
12
  import isValid from "./src/isValid.js";
13
+ import getValidValue from "./src/getValidValue.js";
12
14
 
13
15
  export default Check;
14
16
  export {
15
17
  defined,
18
+ definedValue,
16
19
  isArray,
17
20
  isBoolean,
18
21
  isFunction,
@@ -22,4 +25,5 @@ export {
22
25
  isString,
23
26
  isTypedArray,
24
27
  isValid,
28
+ getValidValue,
25
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lijuhong1981/jscheck",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -0,0 +1,10 @@
1
+ import defined from "./defined.js";
2
+
3
+ function definedValue(...args) {
4
+ for (let i = 0; i < args.length; i++) {
5
+ if (defined(args[i]))
6
+ return args[i];
7
+ }
8
+ };
9
+
10
+ export default definedValue;
@@ -0,0 +1,10 @@
1
+ import isValid from "./isValid.js";
2
+
3
+ function getValidValue(...args) {
4
+ for (let i = 0; i < args.length; i++) {
5
+ if (isValid(args[i]))
6
+ return args[i];
7
+ }
8
+ };
9
+
10
+ export default getValidValue;