diff options
| author | Bobby <[email protected]> | 2026-04-22 07:51:18 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-04-22 07:51:18 +0530 |
| commit | 6e8adbaabedba12e81bf0fdfe3dc42108255bd11 (patch) | |
| tree | 6d0cb2f5d6d029ea93432a1f906ab74bcdfb7917 /utils | |
| parent | 22912c4af19b9055ed95779c4d16020fe3a449eb (diff) | |
| download | hollowdark-6e8adbaabedba12e81bf0fdfe3dc42108255bd11.tar.xz hollowdark-6e8adbaabedba12e81bf0fdfe3dc42108255bd11.zip | |
Migrate remaining relative imports to @hollowdark/*; strip //-comments and doc references, JSDoc-only
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/result/constructors.ts | 2 | ||||
| -rw-r--r-- | utils/result/map.ts | 4 | ||||
| -rw-r--r-- | utils/result/predicates.ts | 2 | ||||
| -rw-r--r-- | utils/result/types.ts | 4 | ||||
| -rw-r--r-- | utils/result/unwrap.ts | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/utils/result/constructors.ts b/utils/result/constructors.ts index b0ed958..6fec0f4 100644 --- a/utils/result/constructors.ts +++ b/utils/result/constructors.ts @@ -1,4 +1,4 @@ -import type { Err, Ok } from './types' +import type { Err, Ok } from '@hollowdark/utils/result/types' export function ok<T>(value: T): Ok<T> { return { ok: true, value } diff --git a/utils/result/map.ts b/utils/result/map.ts index 9cf44a1..6d8697e 100644 --- a/utils/result/map.ts +++ b/utils/result/map.ts @@ -1,5 +1,5 @@ -import { err, ok } from './constructors' -import type { Result } from './types' +import { err, ok } from '@hollowdark/utils/result/constructors' +import type { Result } from '@hollowdark/utils/result/types' /** Map the value of an ok result; pass errors through unchanged. */ export function mapResult<T, U, E>(r: Result<T, E>, f: (value: T) => U): Result<U, E> { diff --git a/utils/result/predicates.ts b/utils/result/predicates.ts index 315eb0d..16e37af 100644 --- a/utils/result/predicates.ts +++ b/utils/result/predicates.ts @@ -1,4 +1,4 @@ -import type { Err, Ok, Result } from './types' +import type { Err, Ok, Result } from '@hollowdark/utils/result/types' export function isOk<T, E>(r: Result<T, E>): r is Ok<T> { return r.ok diff --git a/utils/result/types.ts b/utils/result/types.ts index ee95c08..e22856f 100644 --- a/utils/result/types.ts +++ b/utils/result/types.ts @@ -8,7 +8,7 @@ export type Err<E> = { readonly ok: false; readonly error: E } * Result<T, E> — a recoverable-error return type for functions that can * fail without throwing. Used at system boundaries (save/load, content * validation, manifest fetch) where the caller needs to decide whether a - * failure is fatal. Internal pure logic uses plain returns and throws - * Error for programmer errors (rules/01-code-style.md). + * failure is fatal. Internal pure logic still throws `Error` for + * programmer errors. */ export type Result<T, E = Error> = Ok<T> | Err<E> diff --git a/utils/result/unwrap.ts b/utils/result/unwrap.ts index 84e658e..8f980dd 100644 --- a/utils/result/unwrap.ts +++ b/utils/result/unwrap.ts @@ -1,4 +1,4 @@ -import type { Result } from './types' +import type { Result } from '@hollowdark/utils/result/types' /** * Extract the value from an ok result; throw on error. Reserve for tests |
