utilium 3.4.1 → 3.5.1

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/array.d.ts CHANGED
@@ -112,7 +112,7 @@ export type OptionalTuple<T extends unknown[]> = T extends [infer Head, ...infer
112
112
  * type ducks = FromKeyedArray<ducksArray, 'name'>; // { Gerald: { name: 'Gerald', quacks: 6 }, Dorthy: { name: 'Dorthy', quacks: 7 } }
113
113
  * ```
114
114
  */
115
- export type FromKeyed<A extends any[], KeyName extends A extends (infer E)[] ? keyof E : never> = A extends (infer Element)[] ? {
115
+ export type FromKeyed<A extends any[], KeyName extends (A extends (infer E)[] ? keyof E : never)> = A extends (infer Element)[] ? {
116
116
  [K in Element[KeyName] & PropertyKey]: Expand<Element & {
117
117
  [_ in KeyName & PropertyKey]: K;
118
118
  }>;
package/dist/node.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ /** Whether this process is running with escalated privileges */
2
+ export declare const isRoot: boolean;
package/dist/node.js ADDED
@@ -0,0 +1,16 @@
1
+ // SPDX-License-Identifier: LGPL-3.0-or-later
2
+ // Copyright (c) 2026 James Prevett
3
+ // Misc. Node.js utilities
4
+ /** Whether this process is running with escalated privileges */
5
+ export const isRoot = 'process' in globalThis
6
+ && (process.platform === 'win32'
7
+ ? process
8
+ .getBuiltinModule?.('child_process')
9
+ .spawnSync((process.env.SystemRoot || 'C:\\Windows') + '\\System32\\fltmc.exe', {
10
+ stdio: 'ignore',
11
+ windowsHide: true,
12
+ }).status === 0
13
+ : process.geteuid?.() === 0
14
+ || process.getegid?.() === 0
15
+ || process.getuid?.() === 0
16
+ || process.getgid?.() === 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "3.4.1",
3
+ "version": "3.5.1",
4
4
  "description": "Typescript utilities",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -44,18 +44,24 @@
44
44
  "@eslint/js": "^10.0.1",
45
45
  "@types/node": "^24.7.0",
46
46
  "eslint": "^10.1.0",
47
- "globals": "^15.10.0",
47
+ "globals": "^17.8.0",
48
48
  "prettier": "^3.2.5",
49
49
  "tsx": "^4.19.1",
50
50
  "typedoc": "^0.28.18",
51
51
  "typescript": "^6.0.0",
52
- "typescript-eslint": "^8.58.0"
52
+ "typescript-eslint": "^8.58.0",
53
+ "@xterm/xterm": "^6.0.0"
53
54
  },
54
55
  "dependencies": {
55
56
  "eventemitter3": "^5.0.1"
56
57
  },
57
- "optionalDependencies": {
58
- "@xterm/xterm": "^5.5.0"
58
+ "peerDependencies": {
59
+ "@xterm/xterm": "^6.0.0"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "@xterm/xterm": {
63
+ "optional": true
64
+ }
59
65
  },
60
66
  "engines": {
61
67
  "node": ">=22.0.0"