@elgato/utils 0.6.0 → 0.6.2

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 (91) hide show
  1. package/dist/enumerable.d.ts +1 -0
  2. package/dist/enumerable.js +1 -0
  3. package/dist/event-emitter.d.ts +1 -0
  4. package/dist/event-emitter.js +11 -3
  5. package/dist/explicit-resource-management/deferred.d.ts +1 -0
  6. package/dist/explicit-resource-management/deferred.js +1 -0
  7. package/dist/explicit-resource-management/disposable-stack.d.ts +1 -0
  8. package/dist/explicit-resource-management/disposable-stack.js +1 -0
  9. package/dist/explicit-resource-management/disposable.d.ts +1 -0
  10. package/dist/explicit-resource-management/disposable.js +1 -0
  11. package/dist/explicit-resource-management/index.d.ts +1 -0
  12. package/dist/explicit-resource-management/index.js +1 -0
  13. package/dist/i18n/index.d.ts +1 -0
  14. package/dist/i18n/index.js +1 -0
  15. package/dist/i18n/language.d.ts +1 -0
  16. package/dist/i18n/language.js +1 -0
  17. package/dist/i18n/provider.d.ts +1 -0
  18. package/dist/i18n/provider.js +1 -0
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +1 -0
  21. package/dist/json.d.ts +1 -0
  22. package/dist/json.js +1 -0
  23. package/dist/lazy.d.ts +1 -0
  24. package/dist/lazy.js +1 -0
  25. package/dist/lists/data-list.d.ts +1 -0
  26. package/dist/lists/data-list.js +1 -0
  27. package/dist/lists/option-group.d.ts +1 -0
  28. package/dist/lists/option-group.js +1 -0
  29. package/dist/lists/option-list.d.ts +1 -0
  30. package/dist/lists/option-list.js +1 -0
  31. package/dist/lists/option.d.ts +1 -0
  32. package/dist/lists/option.js +1 -0
  33. package/dist/logging/console-target.d.ts +1 -0
  34. package/dist/logging/console-target.js +1 -0
  35. package/dist/logging/format.d.ts +1 -0
  36. package/dist/logging/format.js +1 -0
  37. package/dist/logging/index.d.ts +1 -0
  38. package/dist/logging/index.js +1 -0
  39. package/dist/logging/level.d.ts +1 -0
  40. package/dist/logging/level.js +1 -0
  41. package/dist/logging/logger.d.ts +1 -0
  42. package/dist/logging/logger.js +1 -0
  43. package/dist/logging/node/file-target.d.ts +1 -0
  44. package/dist/logging/node/file-target.js +7 -3
  45. package/dist/logging/target.d.ts +1 -0
  46. package/dist/logging/target.js +1 -0
  47. package/dist/objects/freeze.d.ts +1 -0
  48. package/dist/objects/freeze.js +1 -0
  49. package/dist/objects/get.d.ts +1 -0
  50. package/dist/objects/get.js +1 -0
  51. package/dist/objects/set.d.ts +1 -0
  52. package/dist/objects/set.js +7 -3
  53. package/dist/parsers.d.ts +1 -0
  54. package/dist/parsers.js +1 -0
  55. package/dist/processes/posix.d.ts +1 -0
  56. package/dist/processes/posix.js +1 -0
  57. package/dist/processes/process-info.d.ts +1 -0
  58. package/dist/processes/process-info.js +1 -0
  59. package/dist/processes/win32.d.ts +1 -0
  60. package/dist/processes/win32.js +1 -0
  61. package/dist/processes.d.ts +1 -0
  62. package/dist/processes.js +1 -0
  63. package/dist/promises.d.ts +1 -0
  64. package/dist/promises.js +1 -0
  65. package/dist/rpc/client.d.ts +1 -0
  66. package/dist/rpc/client.js +1 -0
  67. package/dist/rpc/index.d.ts +1 -0
  68. package/dist/rpc/index.js +1 -0
  69. package/dist/rpc/json-rpc/error.d.ts +1 -0
  70. package/dist/rpc/json-rpc/error.js +1 -0
  71. package/dist/rpc/json-rpc/request.d.ts +1 -0
  72. package/dist/rpc/json-rpc/request.js +2 -4
  73. package/dist/rpc/json-rpc/response.d.ts +1 -0
  74. package/dist/rpc/json-rpc/response.js +1 -0
  75. package/dist/rpc/request.d.ts +1 -0
  76. package/dist/rpc/request.js +1 -0
  77. package/dist/rpc/response.d.ts +1 -0
  78. package/dist/rpc/response.js +1 -0
  79. package/dist/rpc/sender.d.ts +1 -0
  80. package/dist/rpc/sender.js +1 -0
  81. package/dist/rpc/server-client.d.ts +1 -0
  82. package/dist/rpc/server-client.js +1 -0
  83. package/dist/rpc/server.d.ts +1 -0
  84. package/dist/rpc/server.js +1 -0
  85. package/dist/strings.d.ts +1 -0
  86. package/dist/strings.js +1 -0
  87. package/dist/timers.d.ts +1 -0
  88. package/dist/timers.js +1 -0
  89. package/dist/types.d.ts +1 -0
  90. package/dist/types.js +1 -0
  91. package/package.json +24 -27
@@ -139,3 +139,4 @@ export declare class Enumerable<T> implements IterableIterator<T> {
139
139
  */
140
140
  toString(): string;
141
141
  }
142
+ //# sourceMappingURL=enumerable.d.ts.map
@@ -300,3 +300,4 @@ export class Enumerable {
300
300
  return `${this.toArray()}`;
301
301
  }
302
302
  }
303
+ //# sourceMappingURL=enumerable.js.map
@@ -141,3 +141,4 @@ export type EventArgUnion<TMap extends EventMap<TMap>> = {
141
141
  [K in keyof TMap]: TMap[K] extends unknown[] ? [K, (...args: TMap[K]) => void] : never;
142
142
  }[keyof TMap];
143
143
  export {};
144
+ //# sourceMappingURL=event-emitter.d.ts.map
@@ -38,7 +38,11 @@ export class EventEmitter {
38
38
  return false;
39
39
  }
40
40
  for (let i = 0; i < listeners.length;) {
41
- const { listener, once } = listeners[i];
41
+ const { listener, once } = listeners[i] ?? {};
42
+ if (!listener) {
43
+ i++;
44
+ continue;
45
+ }
42
46
  if (once) {
43
47
  this.remove(eventName, listeners, i);
44
48
  }
@@ -92,7 +96,7 @@ export class EventEmitter {
92
96
  off(eventName, listener) {
93
97
  const listeners = this.events.get(eventName) ?? [];
94
98
  for (let i = listeners.length - 1; i >= 0; i--) {
95
- if (listeners[i].listener === listener) {
99
+ if (listeners[i]?.listener === listener) {
96
100
  this.remove(eventName, listeners, i);
97
101
  }
98
102
  }
@@ -183,10 +187,14 @@ export class EventEmitter {
183
187
  * @param index Index of the listener to remove.
184
188
  */
185
189
  remove(eventName, listeners, index) {
186
- const [{ listener }] = listeners.splice(index, 1);
190
+ const [{ listener } = {}] = listeners.splice(index, 1);
191
+ if (listener === undefined) {
192
+ return;
193
+ }
187
194
  if (eventName !== "removeListener") {
188
195
  const args = [eventName, listener];
189
196
  this.emit("removeListener", ...args);
190
197
  }
191
198
  }
192
199
  }
200
+ //# sourceMappingURL=event-emitter.js.map
@@ -5,3 +5,4 @@ import type { IDisposable } from "./disposable.js";
5
5
  * @returns Disposable whereby the disposing is delegated to the {@link dispose} function.
6
6
  */
7
7
  export declare function deferredDisposable(dispose: () => void): IDisposable;
8
+ //# sourceMappingURL=deferred.d.ts.map
@@ -16,3 +16,4 @@ export function deferredDisposable(dispose) {
16
16
  dispose: guardedDispose,
17
17
  };
18
18
  }
19
+ //# sourceMappingURL=deferred.js.map
@@ -37,3 +37,4 @@ export declare class DisposableStack implements IDisposable {
37
37
  */
38
38
  use(value: IDisposable): this;
39
39
  }
40
+ //# sourceMappingURL=disposable-stack.d.ts.map
@@ -73,3 +73,4 @@ export class DisposableStack {
73
73
  return this;
74
74
  }
75
75
  }
76
+ //# sourceMappingURL=disposable-stack.js.map
@@ -11,3 +11,4 @@ export interface IDisposable {
11
11
  */
12
12
  dispose(): void;
13
13
  }
14
+ //# sourceMappingURL=disposable.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=disposable.js.map
@@ -1,3 +1,4 @@
1
1
  export * from "./deferred.js";
2
2
  export * from "./disposable-stack.js";
3
3
  export * from "./disposable.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -4,3 +4,4 @@ Symbol.dispose ??= Symbol("Symbol.dispose");
4
4
  export * from "./deferred.js";
5
5
  export * from "./disposable-stack.js";
6
6
  export * from "./disposable.js";
7
+ //# sourceMappingURL=index.js.map
@@ -1,2 +1,3 @@
1
1
  export * from "./language.js";
2
2
  export * from "./provider.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export * from "./language.js";
2
2
  export * from "./provider.js";
3
+ //# sourceMappingURL=index.js.map
@@ -12,3 +12,4 @@ export type Language<T extends string> = ExtractLanguage<T> | typeof defaultLang
12
12
  */
13
13
  type ExtractLanguage<T extends string> = T extends `_` | `-` | `` ? never : T extends Alphabetical<T> ? T : T extends `${infer L}${`_` | `-`}${infer R}` ? L extends Alphabetical<L> ? R extends Alphabetical<R> ? L | T : never : never : never;
14
14
  export {};
15
+ //# sourceMappingURL=language.d.ts.map
@@ -2,3 +2,4 @@
2
2
  * Default language supported by all i18n providers.
3
3
  */
4
4
  export const defaultLanguage = "en";
5
+ //# sourceMappingURL=language.js.map
@@ -57,3 +57,4 @@ export declare class I18nProvider<T extends string> {
57
57
  * @returns Localized resources represented as a JSON object.
58
58
  */
59
59
  export type TranslationsReader<T extends string> = (language: Language<T>) => JsonObject | null;
60
+ //# sourceMappingURL=provider.d.ts.map
@@ -105,3 +105,4 @@ export class I18nProvider {
105
105
  return translations;
106
106
  }
107
107
  }
108
+ //# sourceMappingURL=provider.js.map
package/dist/index.d.ts CHANGED
@@ -16,3 +16,4 @@ export type { DataList } from "./lists/data-list.js";
16
16
  export { OptionGroup, optionGroup } from "./lists/option-group.js";
17
17
  export type { OptionList } from "./lists/option-list.js";
18
18
  export { Option, option } from "./lists/option.js";
19
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -14,3 +14,4 @@ export * from "./timers.js";
14
14
  export * from "./types.js";
15
15
  export { OptionGroup, optionGroup } from "./lists/option-group.js";
16
16
  export { Option, option } from "./lists/option.js";
17
+ //# sourceMappingURL=index.js.map
package/dist/json.d.ts CHANGED
@@ -12,3 +12,4 @@ export type JsonPrimitive = boolean | number | string | null | undefined;
12
12
  * JSON value.
13
13
  */
14
14
  export type JsonValue = JsonObject | JsonPrimitive | JsonValue[];
15
+ //# sourceMappingURL=json.d.ts.map
package/dist/json.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=json.js.map
package/dist/lazy.d.ts CHANGED
@@ -14,3 +14,4 @@ export declare class Lazy<T> {
14
14
  */
15
15
  get value(): T;
16
16
  }
17
+ //# sourceMappingURL=lazy.d.ts.map
package/dist/lazy.js CHANGED
@@ -28,3 +28,4 @@ export class Lazy {
28
28
  return this.#value;
29
29
  }
30
30
  }
31
+ //# sourceMappingURL=lazy.js.map
@@ -4,3 +4,4 @@ import type { Option } from "./option.js";
4
4
  * Collection of options and/or option groups.
5
5
  */
6
6
  export type DataList = (Option | OptionGroup)[];
7
+ //# sourceMappingURL=data-list.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=data-list.js.map
@@ -36,3 +36,4 @@ export declare function optionGroup(props: OptionGroupProps): OptionGroup;
36
36
  */
37
37
  type OptionGroupProps = Omit<OptionGroup, "type">;
38
38
  export {};
39
+ //# sourceMappingURL=option-group.d.ts.map
@@ -23,3 +23,4 @@ export function optionGroup(props) {
23
23
  options,
24
24
  };
25
25
  }
26
+ //# sourceMappingURL=option-group.js.map
@@ -3,3 +3,4 @@ import type { Option } from "./option.js";
3
3
  * Collection of options.
4
4
  */
5
5
  export type OptionList = Option[];
6
+ //# sourceMappingURL=option-list.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=option-list.js.map
@@ -35,3 +35,4 @@ export declare function option(props: OptionProps): Option;
35
35
  */
36
36
  type OptionProps = Omit<Option, "type">;
37
37
  export {};
38
+ //# sourceMappingURL=option.d.ts.map
@@ -22,3 +22,4 @@ export function option(props) {
22
22
  value,
23
23
  };
24
24
  }
25
+ //# sourceMappingURL=option.js.map
@@ -8,3 +8,4 @@ export declare class ConsoleTarget implements LogTarget {
8
8
  */
9
9
  write(entry: LogEntry): void;
10
10
  }
11
+ //# sourceMappingURL=console-target.d.ts.map
@@ -18,3 +18,4 @@ export class ConsoleTarget {
18
18
  }
19
19
  }
20
20
  }
21
+ //# sourceMappingURL=console-target.js.map
@@ -21,3 +21,4 @@ type StringFormatOptions = {
21
21
  dataOnly?: boolean;
22
22
  };
23
23
  export {};
24
+ //# sourceMappingURL=format.d.ts.map
@@ -45,3 +45,4 @@ function reduce(data) {
45
45
  }
46
46
  return result.trimEnd();
47
47
  }
48
+ //# sourceMappingURL=format.js.map
@@ -3,3 +3,4 @@ export * from "./format.js";
3
3
  export * from "./level.js";
4
4
  export * from "./logger.js";
5
5
  export * from "./target.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -3,3 +3,4 @@ export * from "./format.js";
3
3
  export * from "./level.js";
4
4
  export * from "./logger.js";
5
5
  export * from "./target.js";
6
+ //# sourceMappingURL=index.js.map
@@ -28,3 +28,4 @@ export type LogLevel =
28
28
  * @returns The priority as a number.
29
29
  */
30
30
  export declare function defcon(level: LogLevel): number;
31
+ //# sourceMappingURL=level.d.ts.map
@@ -19,3 +19,4 @@ export function defcon(level) {
19
19
  return 4;
20
20
  }
21
21
  }
22
+ //# sourceMappingURL=level.js.map
@@ -85,3 +85,4 @@ export type LoggerOptions = {
85
85
  */
86
86
  targets: LogTarget[];
87
87
  };
88
+ //# sourceMappingURL=logger.d.ts.map
@@ -118,3 +118,4 @@ export class Logger {
118
118
  return this;
119
119
  }
120
120
  }
121
+ //# sourceMappingURL=logger.js.map
@@ -60,3 +60,4 @@ export type FileTargetOptions = {
60
60
  */
61
61
  maxSize: number;
62
62
  };
63
+ //# sourceMappingURL=file-target.d.ts.map
@@ -63,13 +63,13 @@ export class FileTarget {
63
63
  if (entry.isDirectory() || entry.name.indexOf(this.#options.fileName) < 0) {
64
64
  return prev;
65
65
  }
66
- const match = entry.name.substring(this.#options.fileName.length).match(regex);
67
- if (match?.length !== 2) {
66
+ const logIndex = entry.name.substring(this.#options.fileName.length).match(regex)?.[1];
67
+ if (!logIndex) {
68
68
  return prev;
69
69
  }
70
70
  prev.push({
71
71
  path: path.join(this.#options.dest, entry.name),
72
- index: parseInt(match[1]),
72
+ index: parseInt(logIndex),
73
73
  });
74
74
  return prev;
75
75
  }, [])
@@ -93,6 +93,9 @@ export class FileTarget {
93
93
  const logFiles = this.getLogFiles();
94
94
  for (let i = logFiles.length - 1; i >= 0; i--) {
95
95
  const log = logFiles[i];
96
+ if (!log) {
97
+ continue;
98
+ }
96
99
  if (i >= this.#options.maxFileCount - 1) {
97
100
  fs.rmSync(log.path);
98
101
  }
@@ -102,3 +105,4 @@ export class FileTarget {
102
105
  }
103
106
  }
104
107
  }
108
+ //# sourceMappingURL=file-target.js.map
@@ -30,3 +30,4 @@ export type LogEntry = {
30
30
  * Data to log.
31
31
  */
32
32
  export type LogEntryData = unknown[] | [string, ...unknown[]];
33
+ //# sourceMappingURL=target.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=target.js.map
@@ -3,3 +3,4 @@
3
3
  * @param value Value to freeze.
4
4
  */
5
5
  export declare function freeze<T>(value: T): void;
6
+ //# sourceMappingURL=freeze.d.ts.map
@@ -8,3 +8,4 @@ export function freeze(value) {
8
8
  Object.values(value).forEach(freeze);
9
9
  }
10
10
  }
11
+ //# sourceMappingURL=freeze.js.map
@@ -5,3 +5,4 @@
5
5
  * @returns Value of the property.
6
6
  */
7
7
  export declare function get(source: unknown, path: string): unknown;
8
+ //# sourceMappingURL=get.d.ts.map
@@ -8,3 +8,4 @@ export function get(source, path) {
8
8
  const props = path.split(".");
9
9
  return props.reduce((obj, prop) => obj && obj[prop], source);
10
10
  }
11
+ //# sourceMappingURL=get.js.map
@@ -5,3 +5,4 @@
5
5
  * @param value The value to write.
6
6
  */
7
7
  export declare function set(target: object, path: string, value: unknown): void;
8
+ //# sourceMappingURL=set.d.ts.map
@@ -14,9 +14,12 @@ export function set(target, path, value) {
14
14
  }
15
15
  }
16
16
  // Ensure there is a path to the value.
17
+ const last = props.pop();
18
+ if (last === undefined) {
19
+ return;
20
+ }
17
21
  let curr = target;
18
- for (let i = 0; i < props.length - 1; i++) {
19
- const prop = props[i];
22
+ for (const prop of props) {
20
23
  let value = Object.hasOwn(curr, prop) ? curr[prop] : undefined;
21
24
  if (value === null || (typeof value !== "object" && typeof value !== "function")) {
22
25
  defineProperty(curr, prop, (value = {}));
@@ -24,7 +27,7 @@ export function set(target, path, value) {
24
27
  curr = value;
25
28
  }
26
29
  // Set the value.
27
- defineProperty(curr, props[props.length - 1], value);
30
+ defineProperty(curr, last, value);
28
31
  }
29
32
  /**
30
33
  * Defines a property on the specified object.
@@ -40,3 +43,4 @@ function defineProperty(obj, prop, value) {
40
43
  configurable: true,
41
44
  });
42
45
  }
46
+ //# sourceMappingURL=set.js.map
package/dist/parsers.d.ts CHANGED
@@ -10,3 +10,4 @@ export declare function parseBoolean(value: unknown): boolean;
10
10
  * @returns The parsed value; otherwise `undefined`.
11
11
  */
12
12
  export declare function parseNumber(value: unknown): number | undefined;
13
+ //# sourceMappingURL=parsers.d.ts.map
package/dist/parsers.js CHANGED
@@ -24,3 +24,4 @@ export function parseNumber(value) {
24
24
  value = parseFloat(value);
25
25
  return typeof value === "number" && !isNaN(value) ? value : undefined;
26
26
  }
27
+ //# sourceMappingURL=parsers.js.map
@@ -4,3 +4,4 @@ import type { ProcessInfo } from "./process-info.js";
4
4
  * @returns A promise that resolves to an array of `ProcessInfo` objects representing the currently running processes on the system. Each object contains the PID and the full command line of the process. If the `ps` command fails for any reason, it returns an empty array.
5
5
  */
6
6
  export declare function getPosixProcesses(): Promise<ProcessInfo[]>;
7
+ //# sourceMappingURL=posix.d.ts.map
@@ -24,3 +24,4 @@ export async function getPosixProcesses() {
24
24
  return [];
25
25
  }
26
26
  }
27
+ //# sourceMappingURL=posix.js.map
@@ -11,3 +11,4 @@ export type ProcessInfo = {
11
11
  */
12
12
  commandLine: string;
13
13
  };
14
+ //# sourceMappingURL=process-info.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=process-info.js.map
@@ -4,3 +4,4 @@ import type { ProcessInfo } from "./process-info.js";
4
4
  * @returns A promise that resolves to an array of `ProcessInfo` objects representing the currently running processes on a Windows system. Each object contains the PID and the full command line of the process. If the PowerShell command fails for any reason, it returns an empty array.
5
5
  */
6
6
  export declare function getWindowsProcesses(): Promise<ProcessInfo[]>;
7
+ //# sourceMappingURL=win32.d.ts.map
@@ -30,3 +30,4 @@ export async function getWindowsProcesses() {
30
30
  return [];
31
31
  }
32
32
  }
33
+ //# sourceMappingURL=win32.js.map
@@ -5,3 +5,4 @@ import type { ProcessInfo } from "./processes/process-info.js";
5
5
  */
6
6
  export declare function getProcesses(): Promise<ProcessInfo[]>;
7
7
  export type { ProcessInfo };
8
+ //# sourceMappingURL=processes.d.ts.map
package/dist/processes.js CHANGED
@@ -20,3 +20,4 @@ export async function getProcesses() {
20
20
  throw new Error(`Unsupported platform: ${process.platform}`);
21
21
  }
22
22
  }
23
+ //# sourceMappingURL=processes.js.map
@@ -22,3 +22,4 @@ export type PromiseResolvers<T> = {
22
22
  * @returns The promise, and the resolve and reject functions.
23
23
  */
24
24
  export declare function withResolvers<T = void>(): PromiseResolvers<T>;
25
+ //# sourceMappingURL=promises.d.ts.map
package/dist/promises.js CHANGED
@@ -11,3 +11,4 @@ export function withResolvers() {
11
11
  });
12
12
  return { promise, resolve, reject };
13
13
  }
14
+ //# sourceMappingURL=promises.js.map
@@ -54,3 +54,4 @@ export type RpcClientOptions = {
54
54
  */
55
55
  error?: (response: RpcErrorResponse) => void;
56
56
  };
57
+ //# sourceMappingURL=client.d.ts.map
@@ -147,3 +147,4 @@ export class RpcClient {
147
147
  }
148
148
  }
149
149
  _a = RpcClient;
150
+ //# sourceMappingURL=client.js.map
@@ -7,3 +7,4 @@ export * from "./response.js";
7
7
  export * from "./sender.js";
8
8
  export * from "./server-client.js";
9
9
  export * from "./server.js";
10
+ //# sourceMappingURL=index.d.ts.map
package/dist/rpc/index.js CHANGED
@@ -7,3 +7,4 @@ export * from "./response.js";
7
7
  export * from "./sender.js";
8
8
  export * from "./server-client.js";
9
9
  export * from "./server.js";
10
+ //# sourceMappingURL=index.js.map
@@ -50,3 +50,4 @@ export declare const JsonRpcErrorCode: {
50
50
  * Reserved error codes for JSON-RPC 2.0.
51
51
  */
52
52
  export type JsonRpcErrorCode = (typeof JsonRpcErrorCode)[keyof typeof JsonRpcErrorCode];
53
+ //# sourceMappingURL=error.d.ts.map
@@ -32,3 +32,4 @@ export const JsonRpcErrorCode = {
32
32
  */
33
33
  InternalError: -32603,
34
34
  };
35
+ //# sourceMappingURL=error.js.map
@@ -26,3 +26,4 @@ export type JsonRpcRequest<T extends JsonObject | JsonValue[] | undefined = Json
26
26
  * Request object sent to a server.
27
27
  */
28
28
  export declare const JsonRpcRequest: z.ZodMiniType<JsonRpcRequest>;
29
+ //# sourceMappingURL=request.d.ts.map
@@ -5,9 +5,7 @@ import { z } from "zod/v4-mini";
5
5
  export const JsonRpcRequest = z.object({
6
6
  jsonrpc: z.literal("2.0"),
7
7
  method: z.string(),
8
- params: z.optional(z.union([
9
- z.record(z.string(), z.any()),
10
- z.array(z.any()),
11
- ])),
8
+ params: z.optional(z.union([z.record(z.string(), z.any()), z.array(z.any())])),
12
9
  id: z.optional(z.string()),
13
10
  });
11
+ //# sourceMappingURL=request.js.map
@@ -51,3 +51,4 @@ export declare const JsonRpcResponse: z.ZodMiniUnion<readonly [z.ZodMiniType<Jso
51
51
  * Response object sent to a client.
52
52
  */
53
53
  export type JsonRpcResponse = z.infer<typeof JsonRpcResponse>;
54
+ //# sourceMappingURL=response.d.ts.map
@@ -20,3 +20,4 @@ export const JsonRpcErrorResponse = z.strictObject({
20
20
  * Response object sent to a client.
21
21
  */
22
22
  export const JsonRpcResponse = z.union([JsonRpcSuccessResponse, JsonRpcErrorResponse]);
23
+ //# sourceMappingURL=response.js.map
@@ -20,3 +20,4 @@ export type RpcRequestOptions = {
20
20
  * Parameters that can be sent with a request.
21
21
  */
22
22
  export type RpcRequestParameters = JsonObject | JsonValue[] | undefined;
23
+ //# sourceMappingURL=request.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=request.js.map
@@ -64,3 +64,4 @@ export declare class RpcRequestResponder {
64
64
  */
65
65
  success(result: RpcResponseResult): Promise<void>;
66
66
  }
67
+ //# sourceMappingURL=response.d.ts.map
@@ -67,3 +67,4 @@ export class RpcRequestResponder {
67
67
  }
68
68
  }
69
69
  }
70
+ //# sourceMappingURL=response.js.map
@@ -5,3 +5,4 @@ import type { JsonRpcResponse } from "./json-rpc/response.js";
5
5
  * @param value Request or response to send.
6
6
  */
7
7
  export type RpcSender = (value: JsonRpcRequest | JsonRpcResponse) => Promise<void>;
8
+ //# sourceMappingURL=sender.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=sender.js.map
@@ -20,3 +20,4 @@ export type RpcServerClient = Pick<RpcClient, "notify" | "request"> & Pick<RpcSe
20
20
  */
21
21
  receive(value: JsonValue): Promise<boolean>;
22
22
  };
23
+ //# sourceMappingURL=server-client.d.ts.map
@@ -19,3 +19,4 @@ export function createRpcServerClient(send, options) {
19
19
  },
20
20
  };
21
21
  }
22
+ //# sourceMappingURL=server-client.js.map
@@ -32,3 +32,4 @@ export declare class RpcServer {
32
32
  * @template TParameters Type of the parameter sent with the request.
33
33
  */
34
34
  export type MethodHandler<TParameters extends RpcRequestParameters = undefined> = (parameters: TParameters, responder: RpcRequestResponder, next: () => Promise<RpcResponseResult | void> | RpcResponseResult | void) => Promise<RpcResponseResult | void> | RpcResponseResult | void;
35
+ //# sourceMappingURL=server.d.ts.map
@@ -85,3 +85,4 @@ export class RpcServer {
85
85
  }
86
86
  }
87
87
  }
88
+ //# sourceMappingURL=server.js.map
package/dist/strings.d.ts CHANGED
@@ -9,3 +9,4 @@
9
9
  * @returns The formatted string.
10
10
  */
11
11
  export declare function format(format: string, ...args: unknown[]): string;
12
+ //# sourceMappingURL=strings.d.ts.map
package/dist/strings.js CHANGED
@@ -24,3 +24,4 @@ export function format(format, ...args) {
24
24
  return `{${index}}`;
25
25
  }));
26
26
  }
27
+ //# sourceMappingURL=strings.js.map
package/dist/timers.d.ts CHANGED
@@ -5,3 +5,4 @@
5
5
  * @returns Function that debounces calls.
6
6
  */
7
7
  export declare function debounce<T extends unknown[]>(fn: (...args: T) => Promise<void> | void, delay: number): (...args: T) => Promise<void>;
8
+ //# sourceMappingURL=timers.d.ts.map
package/dist/timers.js CHANGED
@@ -20,3 +20,4 @@ export function debounce(fn, delay) {
20
20
  return resolvers.promise;
21
21
  };
22
22
  }
23
+ //# sourceMappingURL=timers.js.map
package/dist/types.d.ts CHANGED
@@ -18,3 +18,4 @@ export type KeyOf<T, K extends keyof T> = Omit<T[K], "">;
18
18
  */
19
19
  export type Constructor<T = object> = new (...args: any[]) => T;
20
20
  export {};
21
+ //# sourceMappingURL=types.d.ts.map
package/dist/types.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,11 +1,27 @@
1
1
  {
2
2
  "name": "@elgato/utils",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Utilities used throughout the Elgato ecosystem.",
5
- "type": "module",
5
+ "keywords": [
6
+ "elgato"
7
+ ],
8
+ "homepage": "https://github.com/elgatosf/streamdeck/tree/main/packages/utils#readme",
9
+ "bugs": {
10
+ "url": "https://github.com/elgatosf/streamdeck/issues"
11
+ },
12
+ "license": "MIT",
13
+ "author": {
14
+ "name": "Elgato",
15
+ "url": "https://www.elgato.com"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/elgatosf/streamdeck.git"
20
+ },
6
21
  "files": [
7
- "./dist/"
22
+ "./dist/**/*.{d.ts,js}"
8
23
  ],
24
+ "type": "module",
9
25
  "exports": {
10
26
  ".": {
11
27
  "types": "./dist/index.d.ts",
@@ -28,39 +44,20 @@
28
44
  "default": "./dist/rpc/index.js"
29
45
  }
30
46
  },
31
- "prettier": "@elgato/prettier-config",
32
- "repository": {
33
- "type": "git",
34
- "url": "git+https://github.com/elgatosf/streamdeck.git"
35
- },
36
- "keywords": [
37
- "elgato"
38
- ],
39
- "author": {
40
- "name": "Elgato",
41
- "url": "https://www.elgato.com"
42
- },
43
- "license": "MIT",
44
- "bugs": {
45
- "url": "https://github.com/elgatosf/streamdeck/issues"
47
+ "dependencies": {
48
+ "zod": "^3.25.24"
46
49
  },
47
- "homepage": "https://github.com/elgatosf/streamdeck/tree/main/packages/utils#readme",
48
50
  "devDependencies": {
49
51
  "@elgato/eslint-config": "^0.3.2",
50
- "@elgato/prettier-config": "^0.3.3",
51
- "@tsconfig/node20": "^20.1.5",
52
52
  "@types/node": "^22.15.19",
53
53
  "@vitest/coverage-v8": "^3.1.4",
54
54
  "eslint": "^9.39.4",
55
- "prettier": "^3.8.1",
56
55
  "typescript": "^5.8.3",
57
- "vitest": "^3.1.3"
58
- },
59
- "dependencies": {
60
- "zod": "^3.25.24"
56
+ "vitest": "^3.1.3",
57
+ "@elgato/tsconfig": "^0.1.0"
61
58
  },
62
59
  "scripts": {
63
- "build": "rm -rf dist/ && tsc --project tsconfig.build.json",
60
+ "build": "tsc --project tsconfig.build.json",
64
61
  "dev": "tsc --project tsconfig.build.json --watch",
65
62
  "lint": "eslint --max-warnings 0",
66
63
  "preversion": "npm run build && npm test && npm run lint",