is-where 2.0.6 → 2.0.8

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -1
  2. package/package.json +17 -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
- return ((typeof window !== 'undefined' && window.name === 'nodejs') ||
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.6",
3
+ "version": "2.0.8",
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,16 @@
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.3",
15
+ "@cycraft/eslint": "^0.4.11",
22
16
  "@cycraft/tsconfig": "^0.1.2",
23
- "del-cli": "^6.0.0",
24
- "np": "^10.2.0",
25
- "vitest": "^3.0.6"
17
+ "@types/node": "^22.20.4",
18
+ "bumpp": "^12.3.0",
19
+ "del-cli": "^7.0.0",
20
+ "eslint": "^9.20.1",
21
+ "jsr": "^0.14.3",
22
+ "typescript": "^5.9.3",
23
+ "vitest": "^5.0.2"
26
24
  },
27
25
  "files": [
28
26
  "dist"
@@ -60,5 +58,11 @@
60
58
  "url": "https://github.com/mesqueeb/is-where.git"
61
59
  },
62
60
  "homepage": "https://github.com/mesqueeb/is-where#readme",
63
- "bugs": "https://github.com/mesqueeb/is-where/issues"
64
- }
61
+ "bugs": "https://github.com/mesqueeb/is-where/issues",
62
+ "scripts": {
63
+ "test": "vitest run",
64
+ "lint": "tsc --noEmit && eslint ./src",
65
+ "build": "del-cli dist && tsc",
66
+ "release": "pnpm run lint && pnpm run build && pnpm test && bumpp --no-push --all && pnpm publish --no-git-checks && jsr publish ${JSR_TOKEN:+--token $JSR_TOKEN} && 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)\""
67
+ }
68
+ }