@lijuhong1981/jscheck 1.0.13 → 1.0.15

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
@@ -4,6 +4,7 @@ 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";
7
+ import isAsyncFunction from "./src/isAsyncFunction.js";
7
8
  import isInteger from "./src/isInteger.js";
8
9
  import isNumber from "./src/isNumber.js";
9
10
  import isObject from "./src/isObject.js";
@@ -23,6 +24,7 @@ export {
23
24
  isArray,
24
25
  isBoolean,
25
26
  isFunction,
27
+ isAsyncFunction,
26
28
  isInteger,
27
29
  isNumber,
28
30
  isObject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lijuhong1981/jscheck",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "> TODO: description",
5
5
  "author": "lijuhong1981 <lijuhong@hotmail.com>",
6
6
  "homepage": "https://github.com/lijuhong1981/jslibs#readme",
@@ -18,5 +18,5 @@
18
18
  "bugs": {
19
19
  "url": "https://github.com/lijuhong1981/jslibs/issues"
20
20
  },
21
- "gitHead": "22838de2671319dd9c10e3a412d9e252fc917a71"
21
+ "gitHead": "2a6dc8919956a98973b292cbe88c63fd806fc6d8"
22
22
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 是否异步函数
3
+ * @param {Function} func
4
+ * @returns {boolean}
5
+ */
6
+ function isAsyncFunction(func) {
7
+ return func.constructor.name === 'AsyncFunction';
8
+ }
9
+
10
+ export default isAsyncFunction;
package/src/isNumber.js CHANGED
@@ -1,5 +1,5 @@
1
1
  function isNumber(value) {
2
- return typeof value === 'number';
3
- }
2
+ return !isNaN(value);
3
+ };
4
4
 
5
5
  export default isNumber;
@@ -12,6 +12,6 @@ function isTypedArray(value) {
12
12
  value instanceof BigUint64Array)
13
13
  return true;
14
14
  return false;
15
- }
15
+ };
16
16
 
17
17
  export default isTypedArray;
package/src/isValid.js CHANGED
@@ -1,9 +1,7 @@
1
- import isNumber from "./isNumber.js";
2
-
3
1
  function isValid(value) {
4
- if (value === undefined || value === null || (isNumber(value) && isNaN(value)))
2
+ if (value === undefined || value === null || (typeof value === 'number' && isNaN(value)))
5
3
  return false;
6
4
  return true;
7
- }
5
+ };
8
6
 
9
7
  export default isValid;