Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import {
defineCodes,
SuaveplanError,
type SuaveplanErrorOptions,
} from "@suaveplan/error";
/**
* Error code registry for `@suaveplan/pseudo-random`.
*/
export const PSEUDO_RANDOM_CODES = defineCodes("PSEUDO_RANDOM", [
"SEED.INVALID",
"SEED.NOT_FINITE",
"SEED.NOT_SAFE_INT",
"STATE.INVALID",
"STATE.ALGORITHM_MISMATCH",
"ARG.INVALID",
"ARG.EMPTY_ARRAY",
"ARG.NEGATIVE_COUNT",
"ARG.WEIGHTS_INVALID",
] as const);
export type PseudoRandomCode =
(typeof PSEUDO_RANDOM_CODES)[keyof typeof PSEUDO_RANDOM_CODES];
/** Typed error for `@suaveplan/pseudo-random`. */
export class PseudoRandomError extends SuaveplanError<PseudoRandomCode> {
// biome-ignore lint/complexity/noUselessConstructor: widens visibility
public constructor(
code: PseudoRandomCode,
messageKey: string,
options?: SuaveplanErrorOptions
) {
super(code, messageKey, options);
}
}