a-js-tools 0.5.4-beta.0 → 0.5.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.
@@ -1,12 +1,14 @@
1
1
  'use strict';
2
2
 
3
+ var aTypeOfJs = require('a-type-of-js');
4
+
3
5
  /**
4
6
  *
5
7
  * 判断当前环境是否为 node 环境
6
8
  *
7
9
  */
8
10
  function isNode() {
9
- return (typeof window === 'undefined' || typeof window.document === 'undefined');
11
+ return (aTypeOfJs.isUndefined(globalThis.window) || aTypeOfJs.isUndefined(globalThis.window.document));
10
12
  }
11
13
  /**
12
14
  *
@@ -1,10 +1,12 @@
1
+ import { isUndefined } from 'a-type-of-js';
2
+
1
3
  /**
2
4
  *
3
5
  * 判断当前环境是否为 node 环境
4
6
  *
5
7
  */
6
8
  function isNode() {
7
- return (typeof window === 'undefined' || typeof window.document === 'undefined');
9
+ return (isUndefined(globalThis.window) || isUndefined(globalThis.window.document));
8
10
  }
9
11
  /**
10
12
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "0.5.4-beta.0",
3
+ "version": "0.5.4",
4
4
  "name": "a-js-tools",
5
5
  "description": "一点点 🤏 js 函数",
6
6
  "license": "ISC",
@@ -40,5 +40,11 @@
40
40
  "publishConfig": {
41
41
  "access": "public",
42
42
  "registry": "https://registry.npmjs.org/"
43
- }
43
+ },
44
+ "engines": {
45
+ "node": ">=12.0.0"
46
+ },
47
+ "browserslist": [
48
+ "last 2 versions not ie <= 11"
49
+ ]
44
50
  }
@@ -0,0 +1 @@
1
+ import './isNode';
@@ -0,0 +1 @@
1
+ export {};