is-where 2.0.6 → 2.0.7
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/dist/index.js +4 -1
- package/package.json +16 -13
package/dist/index.js
CHANGED
|
@@ -22,7 +22,10 @@ export function isWebWorker() {
|
|
|
22
22
|
}
|
|
23
23
|
/** Returns `true` if the current environment is JS DOM */
|
|
24
24
|
export function isJsDom() {
|
|
25
|
-
|
|
25
|
+
// Node 21+ ships a global `navigator` whose userAgent contains "Node.js", so `window` must exist too
|
|
26
|
+
if (typeof window === 'undefined')
|
|
27
|
+
return false;
|
|
28
|
+
return (window.name === 'nodejs' ||
|
|
26
29
|
(typeof navigator !== 'undefined' &&
|
|
27
30
|
(navigator.userAgent.includes('Node.js') || navigator.userAgent.includes('jsdom'))));
|
|
28
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "is-where",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "JS environment check functions like `isWebkit() isSafari() isBrowser() isNode()` etc. A simple & small integration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -11,18 +11,15 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=18"
|
|
13
13
|
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"test": "vitest run",
|
|
16
|
-
"lint": "tsc --noEmit && eslint ./src",
|
|
17
|
-
"build": "del-cli dist && tsc",
|
|
18
|
-
"release": "npm run lint && npm run build && np"
|
|
19
|
-
},
|
|
20
14
|
"devDependencies": {
|
|
21
|
-
"@cycraft/eslint": "^0.4.
|
|
15
|
+
"@cycraft/eslint": "^0.4.11",
|
|
22
16
|
"@cycraft/tsconfig": "^0.1.2",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
17
|
+
"@types/node": "^22.20.4",
|
|
18
|
+
"bumpp": "^12.3.0",
|
|
19
|
+
"del-cli": "^7.0.0",
|
|
20
|
+
"eslint": "^9.20.1",
|
|
21
|
+
"typescript": "^5.9.3",
|
|
22
|
+
"vitest": "^5.0.2"
|
|
26
23
|
},
|
|
27
24
|
"files": [
|
|
28
25
|
"dist"
|
|
@@ -60,5 +57,11 @@
|
|
|
60
57
|
"url": "https://github.com/mesqueeb/is-where.git"
|
|
61
58
|
},
|
|
62
59
|
"homepage": "https://github.com/mesqueeb/is-where#readme",
|
|
63
|
-
"bugs": "https://github.com/mesqueeb/is-where/issues"
|
|
64
|
-
|
|
60
|
+
"bugs": "https://github.com/mesqueeb/is-where/issues",
|
|
61
|
+
"scripts": {
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"lint": "tsc --noEmit && eslint ./src",
|
|
64
|
+
"build": "del-cli dist && tsc",
|
|
65
|
+
"release": "pnpm run lint && pnpm run build && pnpm test && bumpp --no-push --all && pnpm publish --no-git-checks && npx jsr publish && git push --follow-tags && gh release create $(git describe --tags --abbrev=0) --generate-notes --notes \"$(git log --pretty='- %s %h' $(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || git rev-list --max-parents=0 HEAD)..HEAD~1)\""
|
|
66
|
+
}
|
|
67
|
+
}
|