@evobug_com/safe-ts-feature-node 0.4.0 → 0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evobug_com/safe-ts-feature-node",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "SAFE-TS feature pack for Node: which built-in functions throw or reject, with the exact errors, and safe versions of them that return a Result (one module per Node module), with the error types and guards.",
5
5
  "keywords": [
6
6
  "safe-ts",
@@ -182,9 +182,14 @@
182
182
  "LICENSE-APACHE"
183
183
  ],
184
184
  "peerDependencies": {
185
- "@evobug_com/safe-ts-std": "^0.4.0"
185
+ "@evobug_com/safe-ts-std": "^0.5.1"
186
186
  },
187
187
  "publishConfig": {
188
188
  "access": "public"
189
+ },
190
+ "safe-ts": {
191
+ "trustedFiles": [
192
+ "safe/**"
193
+ ]
189
194
  }
190
195
  }
package/safe/events.d.ts CHANGED
@@ -6,6 +6,6 @@ export { EventEmitter, EventEmitterAsyncResource, addAbortListener, captureRejec
6
6
  export type { Abortable, EventEmitterAsyncResourceOptions, EventEmitterReferencingAsyncResource, InternalEventEmitter, InternalEventTargetEventProperties, NodeEventTarget, OnOptions, OnceOptions } from "node:events";
7
7
 
8
8
  /** `once()` (node:events), with what it rejects with returned as an `Err`: `(the 'error' event's argument)`. */
9
- export declare function once(emitter: $events.EventEmitter, eventName: string | symbol, options?: $events.EventEmitter.OnceOptions): Promise<Result<any[], unknown>>;
9
+ export declare function once(emitter: $events.EventEmitter, eventName: string | symbol, options?: $events.EventEmitter.OnceOptions): Promise<Result<unknown[], unknown>>;
10
10
  /** `once()` (node:events), with what it rejects with returned as an `Err`: `(the 'error' event's argument)`. */
11
- export declare function once(emitter: EventTarget, eventName: string, options?: $events.EventEmitter.OnceOptions): Promise<Result<any[], unknown>>;
11
+ export declare function once(emitter: EventTarget, eventName: string, options?: $events.EventEmitter.OnceOptions): Promise<Result<unknown[], unknown>>;
package/safe/module.d.ts CHANGED
@@ -14,7 +14,7 @@ export declare function register<Data = any>(specifier: string | $url.URL, paren
14
14
  /** `register()` (node:module), with what it throws returned as an `Err`: `Error [ERR_MODULE_NOT_FOUND] | (what the hooks module throws)`. */
15
15
  export declare function register<Data = any>(specifier: string | $url.URL, options?: $module.Module.RegisterOptions<Data>): Result<void, unknown>;
16
16
  /** `Module#require()` (node:module), with what it throws returned as an `Err`: `Error [MODULE_NOT_FOUND] {requireStack} | (what the module throws)`. */
17
- export declare function require(module: $module.Module, id: string): Result<any, unknown>;
17
+ export declare function require(module: $module.Module, id: string): Result<unknown, unknown>;
18
18
  /** `runMain()` (node:module), with what it throws returned as an `Err`: `(what the main module throws)`. */
19
19
  export declare function runMain(main?: string): Result<void, unknown>;
20
20
  /** `stripTypeScriptTypes()` (node:module), with what it throws returned as an `Err`: `SyntaxError [ERR_INVALID_TYPESCRIPT_SYNTAX | ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX]`. */
package/safe/stream.d.ts CHANGED
@@ -8,22 +8,22 @@ export { Duplex, PassThrough, Readable, Stream, Transform, Writable, addAbortSig
8
8
  export type { ArrayOptions, ComposeDestination, ComposeSource, ComposeTransform, ComposeTransformGenerator, ComposeTransformSource, ComposeTransformStreams, DuplexEventMap, DuplexOptions, DuplexToWebOptions, FinishedOptions, PipeOptions, PipelineCallback, PipelineDestination, PipelineDestinationFunction, PipelineResult, PipelineSource, PipelineSourceArgument, PipelineSourceFunction, PipelineTransform, PipelineTransformGenerator, PipelineTransformSource, PipelineTransformStreams, ReadableEventMap, ReadableIteratorOptions, ReadableOperatorOptions, ReadableOptions, ReadableToWebOptions, StreamOptions, TransformCallback, TransformOptions, WritableEventMap, WritableOptions } from "node:stream";
9
9
 
10
10
  /** `Readable#every()` (node:stream), with what it rejects with returned as an `Err`: `(the stream's error) | (what your callback throws)`. */
11
- export declare function every(readable: $stream.Stream.Readable, fn: (data: any, options?: $events.Abortable) => boolean | Promise<boolean>, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<boolean, unknown>>;
11
+ export declare function every(readable: $stream.Stream.Readable, fn: (data: unknown, options?: $events.Abortable) => boolean | Promise<boolean>, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<boolean, unknown>>;
12
12
  /** `Readable#find()` (node:stream), with what it rejects with returned as an `Err`: `(the stream's error) | (what your callback throws)`. */
13
- export declare function find<T>(readable: $stream.Stream.Readable, fn: (data: any, options?: $events.Abortable) => data is T, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<T | undefined, unknown>>;
13
+ export declare function find<T>(readable: $stream.Stream.Readable, fn: (data: unknown, options?: $events.Abortable) => data is T, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<T | undefined, unknown>>;
14
14
  /** `Readable#find()` (node:stream), with what it rejects with returned as an `Err`: `(the stream's error) | (what your callback throws)`. */
15
- export declare function find(readable: $stream.Stream.Readable, fn: (data: any, options?: $events.Abortable) => boolean | Promise<boolean>, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<any, unknown>>;
15
+ export declare function find(readable: $stream.Stream.Readable, fn: (data: unknown, options?: $events.Abortable) => boolean | Promise<boolean>, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<unknown, unknown>>;
16
16
  /** `Readable#forEach()` (node:stream), with what it rejects with returned as an `Err`: `(the stream's error) | (what your callback throws)`. */
17
- export declare function forEach(readable: $stream.Stream.Readable, fn: (data: any, options?: $events.Abortable) => void | Promise<void>, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<void, unknown>>;
17
+ export declare function forEach(readable: $stream.Stream.Readable, fn: (data: unknown, options?: $events.Abortable) => void | Promise<void>, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<void, unknown>>;
18
18
  /** `isReadable()` (node:stream), with `null` returned as `undefined`. */
19
19
  export declare function isReadable(stream: NodeJS.ReadableStream | $streamWeb.ReadableStream): Option<boolean>;
20
20
  /** `isWritable()` (node:stream), with `null` returned as `undefined`. */
21
21
  export declare function isWritable(stream: NodeJS.WritableStream | $streamWeb.WritableStream): Option<boolean>;
22
22
  /** `Readable#reduce()` (node:stream), with what it rejects with returned as an `Err`: `(the stream's error) | (what your callback throws)`. */
23
- export declare function reduce<T>(readable: $stream.Stream.Readable, fn: (previous: any, data: any, options?: $events.Abortable) => T): Promise<Result<T, unknown>>;
23
+ export declare function reduce<T>(readable: $stream.Stream.Readable, fn: (previous: unknown, data: unknown, options?: $events.Abortable) => T): Promise<Result<T, unknown>>;
24
24
  /** `Readable#reduce()` (node:stream), with what it rejects with returned as an `Err`: `(the stream's error) | (what your callback throws)`. */
25
- export declare function reduce<T>(readable: $stream.Stream.Readable, fn: (previous: T, data: any, options?: $events.Abortable) => T, initial: T, options?: $events.Abortable): Promise<Result<T, unknown>>;
25
+ export declare function reduce<T>(readable: $stream.Stream.Readable, fn: (previous: T, data: unknown, options?: $events.Abortable) => T, initial: T, options?: $events.Abortable): Promise<Result<T, unknown>>;
26
26
  /** `Readable#some()` (node:stream), with what it rejects with returned as an `Err`: `(the stream's error) | (what your callback throws)`. */
27
- export declare function some(readable: $stream.Stream.Readable, fn: (data: any, options?: $events.Abortable) => boolean | Promise<boolean>, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<boolean, unknown>>;
27
+ export declare function some(readable: $stream.Stream.Readable, fn: (data: unknown, options?: $events.Abortable) => boolean | Promise<boolean>, options?: Pick<$stream.Stream.ReadableOperatorOptions, "concurrency" | "signal">): Promise<Result<boolean, unknown>>;
28
28
  /** `Readable#toArray()` (node:stream), with what it rejects with returned as an `Err`: `(the stream's error)`. */
29
- export declare function toArray(readable: $stream.Stream.Readable, options?: $events.Abortable): Promise<Result<any[], unknown>>;
29
+ export declare function toArray(readable: $stream.Stream.Readable, options?: $events.Abortable): Promise<Result<unknown[], unknown>>;
package/safe/v8.d.ts CHANGED
@@ -7,7 +7,7 @@ import type * as $v8 from "node:v8";
7
7
  export * from "node:v8";
8
8
 
9
9
  /** `deserialize()` (node:v8), with what it throws returned as an `Err`: `Error`. */
10
- export declare function deserialize(buffer: NodeJS.ArrayBufferView): Result<any, PlainError<"Error">>;
10
+ export declare function deserialize(buffer: NodeJS.ArrayBufferView): Result<unknown, PlainError<"Error">>;
11
11
  /** `Deserializer#readDouble()` (node:v8), with what it throws returned as an `Err`: `Error`. */
12
12
  export declare function readDouble(deserializer: $v8.Deserializer): Result<number, PlainError<"Error">>;
13
13
  /** `Deserializer#readHeader()` (node:v8), with what it throws returned as an `Err`: `Error`. */
@@ -19,7 +19,7 @@ export declare function readUint32(deserializer: $v8.Deserializer): Result<numbe
19
19
  /** `Deserializer#readUint64()` (node:v8), with what it throws returned as an `Err`: `Error`. */
20
20
  export declare function readUint64(deserializer: $v8.Deserializer): Result<[number, number], PlainError<"Error">>;
21
21
  /** `Deserializer#readValue()` (node:v8), with what it throws returned as an `Err`: `Error`. */
22
- export declare function readValue(deserializer: $v8.Deserializer): Result<any, PlainError<"Error">>;
22
+ export declare function readValue(deserializer: $v8.Deserializer): Result<unknown, PlainError<"Error">>;
23
23
  /** `serialize()` (node:v8), with what it throws returned as an `Err`: `Error`. */
24
24
  export declare function serialize(value: any): Result<$buffer.NonSharedBuffer, PlainError<"Error">>;
25
25
  /** `writeHeapSnapshot()` (node:v8), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open', path}`. */
package/safe/vm.d.ts CHANGED
@@ -10,14 +10,14 @@ export declare function compileFunction(code: string, params?: readonly string[]
10
10
  /** `new Script()` (node:vm), with what it throws returned as an `Err`: `SyntaxError`. */
11
11
  export declare function newScript(code: string, options?: $vm.ScriptOptions | string): Result<$vm.Script, PlainError<"SyntaxError">>;
12
12
  /** `runInContext()` (node:vm), with what it throws returned as an `Err`: `SyntaxError | (what the code throws)`. */
13
- export declare function runInContext(code: string, contextifiedObject: $vm.Context, options?: $vm.RunningCodeOptions | string): Result<any, unknown>;
13
+ export declare function runInContext(code: string, contextifiedObject: $vm.Context, options?: $vm.RunningCodeOptions | string): Result<unknown, unknown>;
14
14
  /** `runInNewContext()` (node:vm), with what it throws returned as an `Err`: `SyntaxError | (what the code throws)`. */
15
- export declare function runInNewContext(code: string, contextObject?: $vm.Context | typeof $vm.constants.DONT_CONTEXTIFY, options?: $vm.RunningCodeInNewContextOptions | string): Result<any, unknown>;
15
+ export declare function runInNewContext(code: string, contextObject?: $vm.Context | typeof $vm.constants.DONT_CONTEXTIFY, options?: $vm.RunningCodeInNewContextOptions | string): Result<unknown, unknown>;
16
16
  /** `runInThisContext()` (node:vm), with what it throws returned as an `Err`: `SyntaxError | (what the code throws)`. */
17
- export declare function runInThisContext(code: string, options?: $vm.RunningCodeOptions | string): Result<any, unknown>;
17
+ export declare function runInThisContext(code: string, options?: $vm.RunningCodeOptions | string): Result<unknown, unknown>;
18
18
  /** `Script#runInContext()` (node:vm), with what it throws returned as an `Err`: `(what the code throws)`. */
19
- export declare function scriptRunInContext(script: $vm.Script, contextifiedObject: $vm.Context, options?: $vm.RunningScriptOptions): Result<any, unknown>;
19
+ export declare function scriptRunInContext(script: $vm.Script, contextifiedObject: $vm.Context, options?: $vm.RunningScriptOptions): Result<unknown, unknown>;
20
20
  /** `Script#runInNewContext()` (node:vm), with what it throws returned as an `Err`: `(what the code throws)`. */
21
- export declare function scriptRunInNewContext(script: $vm.Script, contextObject?: $vm.Context | typeof $vm.constants.DONT_CONTEXTIFY, options?: $vm.RunningScriptInNewContextOptions): Result<any, unknown>;
21
+ export declare function scriptRunInNewContext(script: $vm.Script, contextObject?: $vm.Context | typeof $vm.constants.DONT_CONTEXTIFY, options?: $vm.RunningScriptInNewContextOptions): Result<unknown, unknown>;
22
22
  /** `Script#runInThisContext()` (node:vm), with what it throws returned as an `Err`: `(what the code throws)`. */
23
- export declare function scriptRunInThisContext(script: $vm.Script, options?: $vm.RunningScriptOptions): Result<any, unknown>;
23
+ export declare function scriptRunInThisContext(script: $vm.Script, options?: $vm.RunningScriptOptions): Result<unknown, unknown>;