@prisma-next/utils
Advanced tools
| //#region src/internal-error.ts | ||
| /** | ||
| * A bug in Prisma Next, not a user error. Never catch this except at the | ||
| * outermost boundary for crash reporting — an InternalError means an invariant | ||
| * broke and the process cannot reliably continue. User-facing failures use | ||
| * `structuredError` with a dotted code instead. | ||
| */ | ||
| var InternalError = class extends Error { | ||
| isPrismaInternalError = true; | ||
| constructor(message, options) { | ||
| super(message, options?.cause !== void 0 ? { cause: options.cause } : void 0); | ||
| this.name = "InternalError"; | ||
| } | ||
| }; | ||
| function isInternalError(e) { | ||
| return typeof e === "object" && e !== null && "isPrismaInternalError" in e && e.isPrismaInternalError === true; | ||
| } | ||
| function assertNever(value, message) { | ||
| throw new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`); | ||
| } | ||
| //#endregion | ||
| export { assertNever as n, isInternalError as r, InternalError as t }; | ||
| //# sourceMappingURL=internal-error-BIc-ehme.mjs.map |
| {"version":3,"file":"internal-error-BIc-ehme.mjs","names":[],"sources":["../src/internal-error.ts"],"sourcesContent":["/**\n * A bug in Prisma Next, not a user error. Never catch this except at the\n * outermost boundary for crash reporting — an InternalError means an invariant\n * broke and the process cannot reliably continue. User-facing failures use\n * `structuredError` with a dotted code instead.\n */\nexport class InternalError extends Error {\n readonly isPrismaInternalError = true;\n\n constructor(message: string, options?: { readonly cause?: unknown }) {\n super(message, options?.cause !== undefined ? { cause: options.cause } : undefined);\n this.name = 'InternalError';\n }\n}\n\nexport function isInternalError(e: unknown): e is InternalError {\n return (\n typeof e === 'object' &&\n e !== null &&\n 'isPrismaInternalError' in e &&\n e.isPrismaInternalError === true\n );\n}\n\nexport function assertNever(value: never, message?: string): never {\n throw new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`);\n}\n"],"mappings":";;;;;;;AAMA,IAAa,gBAAb,cAAmC,MAAM;CACvC,wBAAiC;CAEjC,YAAY,SAAiB,SAAwC;EACnE,MAAM,SAAS,SAAS,UAAU,KAAA,IAAY,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAA,CAAS;EAClF,KAAK,OAAO;CACd;AACF;AAEA,SAAgB,gBAAgB,GAAgC;CAC9D,OACE,OAAO,MAAM,YACb,MAAM,QACN,2BAA2B,KAC3B,EAAE,0BAA0B;AAEhC;AAEA,SAAgB,YAAY,OAAc,SAAyB;CACjE,MAAM,IAAI,cAAc,WAAW,iCAAiC,OAAO,KAAK,GAAG;AACrF"} |
| //#region src/internal-error.d.ts | ||
| /** | ||
| * A bug in Prisma Next, not a user error. Never catch this except at the | ||
| * outermost boundary for crash reporting — an InternalError means an invariant | ||
| * broke and the process cannot reliably continue. User-facing failures use | ||
| * `structuredError` with a dotted code instead. | ||
| */ | ||
| declare class InternalError extends Error { | ||
| readonly isPrismaInternalError = true; | ||
| constructor(message: string, options?: { | ||
| readonly cause?: unknown; | ||
| }); | ||
| } | ||
| declare function isInternalError(e: unknown): e is InternalError; | ||
| declare function assertNever(value: never, message?: string): never; | ||
| //#endregion | ||
| export { InternalError, assertNever, isInternalError }; | ||
| //# sourceMappingURL=internal-error.d.mts.map |
| {"version":3,"file":"internal-error.d.mts","names":[],"sources":["../src/internal-error.ts"],"mappings":";;;;;;;cAMa,sBAAsB;WACxB;cAEG,iBAAiB;aAAqB;;;iBAMpC,gBAAgB,aAAa,KAAK;iBASlC,YAAY,cAAc"} |
| import { n as assertNever, r as isInternalError, t as InternalError } from "./internal-error-BIc-ehme.mjs"; | ||
| export { InternalError, assertNever, isInternalError }; |
| //#region src/structured-error.d.ts | ||
| interface StructuredError extends Error { | ||
| readonly code: `${string}.${string}`; | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| readonly where?: { | ||
| readonly path?: string; | ||
| readonly line?: number; | ||
| }; | ||
| readonly severity?: 'error' | 'warn' | 'info'; | ||
| readonly meta?: Record<string, unknown>; | ||
| readonly docsUrl?: string; | ||
| } | ||
| interface StructuredErrorOptions { | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| readonly where?: { | ||
| readonly path?: string; | ||
| readonly line?: number; | ||
| }; | ||
| readonly severity?: 'error' | 'warn' | 'info'; | ||
| readonly meta?: Record<string, unknown>; | ||
| readonly docsUrl?: string; | ||
| readonly cause?: unknown; | ||
| } | ||
| declare function isStructuredError(e: unknown): e is StructuredError; | ||
| declare function structuredError(code: StructuredError['code'], message: string, options?: StructuredErrorOptions): StructuredError; | ||
| declare const DOCS_ERRORS_VERSION = "next"; | ||
| declare const DOCS_BASE = "https://docs.prisma.io/docs/orm/next/reference/error-reference"; | ||
| declare function docsUrlFor(code: string): string; | ||
| //#endregion | ||
| export { DOCS_BASE, DOCS_ERRORS_VERSION, type StructuredError, type StructuredErrorOptions, docsUrlFor, isStructuredError, structuredError }; | ||
| //# sourceMappingURL=structured-error.d.mts.map |
| {"version":3,"file":"structured-error.d.mts","names":[],"sources":["../src/structured-error.ts"],"mappings":";UAEiB,wBAAwB;WAC9B;WACA;WACA;WACA;aAAmB;aAAwB;;WAC3C;WACA,OAAO;WACP;;UAGM;WACN;WACA;WACA;aAAmB;aAAwB;;WAC3C;WACA,OAAO;WACP;WACA;;iBAKK,kBAAkB,aAAa,KAAK;iBAYpC,gBACd,MAAM,yBACN,iBACA,UAAU,yBACT;cAiBU;cACA;iBAEG,WAAW"} |
| import { t as ifDefined } from "./defined-BQWA85QH.mjs"; | ||
| //#region src/structured-error.ts | ||
| const STRUCTURED_CODE_RE = /^[A-Z][A-Z0-9]*\.[A-Z][A-Z0-9_]*$/; | ||
| function isStructuredError(e) { | ||
| return typeof e === "object" && e !== null && "code" in e && typeof e.code === "string" && STRUCTURED_CODE_RE.test(e.code) && "message" in e && typeof e.message === "string"; | ||
| } | ||
| function structuredError(code, message, options) { | ||
| const error = options?.cause !== void 0 ? new Error(message, { cause: options.cause }) : new Error(message); | ||
| Object.defineProperty(error, "name", { | ||
| value: "StructuredError", | ||
| configurable: true | ||
| }); | ||
| return Object.assign(error, { | ||
| code, | ||
| ...ifDefined("why", options?.why), | ||
| ...ifDefined("fix", options?.fix), | ||
| ...ifDefined("where", options?.where), | ||
| ...ifDefined("severity", options?.severity), | ||
| ...ifDefined("meta", options?.meta), | ||
| ...ifDefined("docsUrl", options?.docsUrl) | ||
| }); | ||
| } | ||
| const DOCS_ERRORS_VERSION = "next"; | ||
| const DOCS_BASE = `https://docs.prisma.io/docs/orm/${DOCS_ERRORS_VERSION}/reference/error-reference`; | ||
| function docsUrlFor(code) { | ||
| return `${DOCS_BASE}#${code}`; | ||
| } | ||
| //#endregion | ||
| export { DOCS_BASE, DOCS_ERRORS_VERSION, docsUrlFor, isStructuredError, structuredError }; | ||
| //# sourceMappingURL=structured-error.mjs.map |
| {"version":3,"file":"structured-error.mjs","names":[],"sources":["../src/structured-error.ts"],"sourcesContent":["import { ifDefined } from './defined';\n\nexport interface StructuredError extends Error {\n readonly code: `${string}.${string}`;\n readonly why?: string;\n readonly fix?: string;\n readonly where?: { readonly path?: string; readonly line?: number };\n readonly severity?: 'error' | 'warn' | 'info';\n readonly meta?: Record<string, unknown>;\n readonly docsUrl?: string;\n}\n\nexport interface StructuredErrorOptions {\n readonly why?: string;\n readonly fix?: string;\n readonly where?: { readonly path?: string; readonly line?: number };\n readonly severity?: 'error' | 'warn' | 'info';\n readonly meta?: Record<string, unknown>;\n readonly docsUrl?: string;\n readonly cause?: unknown;\n}\n\nconst STRUCTURED_CODE_RE = /^[A-Z][A-Z0-9]*\\.[A-Z][A-Z0-9_]*$/;\n\nexport function isStructuredError(e: unknown): e is StructuredError {\n return (\n typeof e === 'object' &&\n e !== null &&\n 'code' in e &&\n typeof e.code === 'string' &&\n STRUCTURED_CODE_RE.test(e.code) &&\n 'message' in e &&\n typeof e.message === 'string'\n );\n}\n\nexport function structuredError(\n code: StructuredError['code'],\n message: string,\n options?: StructuredErrorOptions,\n): StructuredError {\n const error =\n options?.cause !== undefined\n ? new Error(message, { cause: options.cause })\n : new Error(message);\n Object.defineProperty(error, 'name', { value: 'StructuredError', configurable: true });\n return Object.assign(error, {\n code,\n ...ifDefined('why', options?.why),\n ...ifDefined('fix', options?.fix),\n ...ifDefined('where', options?.where),\n ...ifDefined('severity', options?.severity),\n ...ifDefined('meta', options?.meta),\n ...ifDefined('docsUrl', options?.docsUrl),\n });\n}\n\nexport const DOCS_ERRORS_VERSION = 'next';\nexport const DOCS_BASE = `https://docs.prisma.io/docs/orm/${DOCS_ERRORS_VERSION}/reference/error-reference`;\n\nexport function docsUrlFor(code: string): string {\n return `${DOCS_BASE}#${code}`;\n}\n"],"mappings":";;AAsBA,MAAM,qBAAqB;AAE3B,SAAgB,kBAAkB,GAAkC;CAClE,OACE,OAAO,MAAM,YACb,MAAM,QACN,UAAU,KACV,OAAO,EAAE,SAAS,YAClB,mBAAmB,KAAK,EAAE,IAAI,KAC9B,aAAa,KACb,OAAO,EAAE,YAAY;AAEzB;AAEA,SAAgB,gBACd,MACA,SACA,SACiB;CACjB,MAAM,QACJ,SAAS,UAAU,KAAA,IACf,IAAI,MAAM,SAAS,EAAE,OAAO,QAAQ,MAAM,CAAC,IAC3C,IAAI,MAAM,OAAO;CACvB,OAAO,eAAe,OAAO,QAAQ;EAAE,OAAO;EAAmB,cAAc;CAAK,CAAC;CACrF,OAAO,OAAO,OAAO,OAAO;EAC1B;EACA,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,SAAS,SAAS,KAAK;EACpC,GAAG,UAAU,YAAY,SAAS,QAAQ;EAC1C,GAAG,UAAU,QAAQ,SAAS,IAAI;EAClC,GAAG,UAAU,WAAW,SAAS,OAAO;CAC1C,CAAC;AACH;AAEA,MAAa,sBAAsB;AACnC,MAAa,YAAY,mCAAmC,oBAAoB;AAEhF,SAAgB,WAAW,MAAsB;CAC/C,OAAO,GAAG,UAAU,GAAG;AACzB"} |
| export { assertNever, InternalError, isInternalError } from '../internal-error'; |
| export type { StructuredError, StructuredErrorOptions } from '../structured-error'; | ||
| export { | ||
| DOCS_BASE, | ||
| DOCS_ERRORS_VERSION, | ||
| docsUrlFor, | ||
| isStructuredError, | ||
| structuredError, | ||
| } from '../structured-error'; |
| /** | ||
| * A bug in Prisma Next, not a user error. Never catch this except at the | ||
| * outermost boundary for crash reporting — an InternalError means an invariant | ||
| * broke and the process cannot reliably continue. User-facing failures use | ||
| * `structuredError` with a dotted code instead. | ||
| */ | ||
| export class InternalError extends Error { | ||
| readonly isPrismaInternalError = true; | ||
| constructor(message: string, options?: { readonly cause?: unknown }) { | ||
| super(message, options?.cause !== undefined ? { cause: options.cause } : undefined); | ||
| this.name = 'InternalError'; | ||
| } | ||
| } | ||
| export function isInternalError(e: unknown): e is InternalError { | ||
| return ( | ||
| typeof e === 'object' && | ||
| e !== null && | ||
| 'isPrismaInternalError' in e && | ||
| e.isPrismaInternalError === true | ||
| ); | ||
| } | ||
| export function assertNever(value: never, message?: string): never { | ||
| throw new InternalError(message ?? `Unreachable: unexpected value ${String(value)}`); | ||
| } |
| import { ifDefined } from './defined'; | ||
| export interface StructuredError extends Error { | ||
| readonly code: `${string}.${string}`; | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| readonly where?: { readonly path?: string; readonly line?: number }; | ||
| readonly severity?: 'error' | 'warn' | 'info'; | ||
| readonly meta?: Record<string, unknown>; | ||
| readonly docsUrl?: string; | ||
| } | ||
| export interface StructuredErrorOptions { | ||
| readonly why?: string; | ||
| readonly fix?: string; | ||
| readonly where?: { readonly path?: string; readonly line?: number }; | ||
| readonly severity?: 'error' | 'warn' | 'info'; | ||
| readonly meta?: Record<string, unknown>; | ||
| readonly docsUrl?: string; | ||
| readonly cause?: unknown; | ||
| } | ||
| const STRUCTURED_CODE_RE = /^[A-Z][A-Z0-9]*\.[A-Z][A-Z0-9_]*$/; | ||
| export function isStructuredError(e: unknown): e is StructuredError { | ||
| return ( | ||
| typeof e === 'object' && | ||
| e !== null && | ||
| 'code' in e && | ||
| typeof e.code === 'string' && | ||
| STRUCTURED_CODE_RE.test(e.code) && | ||
| 'message' in e && | ||
| typeof e.message === 'string' | ||
| ); | ||
| } | ||
| export function structuredError( | ||
| code: StructuredError['code'], | ||
| message: string, | ||
| options?: StructuredErrorOptions, | ||
| ): StructuredError { | ||
| const error = | ||
| options?.cause !== undefined | ||
| ? new Error(message, { cause: options.cause }) | ||
| : new Error(message); | ||
| Object.defineProperty(error, 'name', { value: 'StructuredError', configurable: true }); | ||
| return Object.assign(error, { | ||
| code, | ||
| ...ifDefined('why', options?.why), | ||
| ...ifDefined('fix', options?.fix), | ||
| ...ifDefined('where', options?.where), | ||
| ...ifDefined('severity', options?.severity), | ||
| ...ifDefined('meta', options?.meta), | ||
| ...ifDefined('docsUrl', options?.docsUrl), | ||
| }); | ||
| } | ||
| export const DOCS_ERRORS_VERSION = 'next'; | ||
| export const DOCS_BASE = `https://docs.prisma.io/docs/orm/${DOCS_ERRORS_VERSION}/reference/error-reference`; | ||
| export function docsUrlFor(code: string): string { | ||
| return `${DOCS_BASE}#${code}`; | ||
| } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"abortable.d.mts","names":[],"sources":["../src/abortable.ts"],"mappings":";;AAuBA;;;;;;;;;;;;;;;;;;;AAAqF;;;iBAArE,SAAA,CAAU,MAAA,EAAQ,WAAA,OAAkB,OAAA,EAAS,OAAA,CAAQ,CAAA,MAAO,OAAA,CAAQ,CAAA"} | ||
| {"version":3,"file":"abortable.d.mts","names":[],"sources":["../src/abortable.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;iBAuBgB,UAAU,QAAQ,eAAe,GAAG,SAAS,QAAQ,OAAO,QAAQ"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"array-equal.d.mts","names":[],"sources":["../src/array-equal.ts"],"mappings":";;AAgBA;;;;;;;;;;AAAgE;;;;;iBAAhD,YAAA,IAAgB,CAAA,WAAY,CAAA,IAAK,CAAA,WAAY,CAAC"} | ||
| {"version":3,"file":"array-equal.d.mts","names":[],"sources":["../src/array-equal.ts"],"mappings":";;;;;;;;;;;;;;;;;iBAgBgB,aAAa,GAAG,YAAY,KAAK,YAAY"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"assertions.d.mts","names":[],"sources":["../src/assertions.ts"],"mappings":";;AAaA;;;;;;;;;;;AAAkG;iBAAlF,aAAA,IAAiB,KAAA,EAAO,CAAA,qBAAsB,OAAA,mBAA0B,KAAA,IAAS,CAAC;;;;;;;;AAiBjB;;;;iBAAjE,SAAA,CAAU,SAAA,WAAoB,OAAA,mBAA0B,SAAA"} | ||
| {"version":3,"file":"assertions.d.mts","names":[],"sources":["../src/assertions.ts"],"mappings":";;;;;;;;;;;;;;iBAegB,cAAc,GAAG,OAAO,sBAAsB,0BAA0B,SAAS;;;;;;;;;;;;iBAiBjF,UAAU,oBAAoB,0BAA0B"} |
@@ -0,1 +1,2 @@ | ||
| import { t as InternalError } from "./internal-error-BIc-ehme.mjs"; | ||
| //#region src/assertions.ts | ||
@@ -16,3 +17,3 @@ /** | ||
| function assertDefined(value, message) { | ||
| if (value === null || value === void 0) throw new Error(message); | ||
| if (value === null || value === void 0) throw new InternalError(message); | ||
| } | ||
@@ -31,3 +32,3 @@ /** | ||
| function invariant(condition, message) { | ||
| if (!condition) throw new Error(message); | ||
| if (!condition) throw new InternalError(message); | ||
| } | ||
@@ -34,0 +35,0 @@ //#endregion |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"assertions.mjs","names":[],"sources":["../src/assertions.ts"],"sourcesContent":["/**\n * Asserts that a value is defined (not null or undefined).\n * Use for invariants where the value should always exist at runtime.\n *\n * @throws Error if value is null or undefined\n *\n * @example\n * ```typescript\n * const table = storage.namespaces[namespaceId].entries.table[tableName];\n * assertDefined(table, `Table \"${tableName}\" not found`);\n * // table is now narrowed to non-nullable\n * ```\n */\nexport function assertDefined<T>(value: T | null | undefined, message: string): asserts value is T {\n if (value === null || value === undefined) {\n throw new Error(message);\n }\n}\n\n/**\n * Asserts that a condition is true.\n * Use for invariants that should always hold at runtime.\n *\n * @throws Error if condition is false\n *\n * @example\n * ```typescript\n * invariant(columns.length > 0, 'Primary key must have at least one column');\n * ```\n */\nexport function invariant(condition: boolean, message: string): asserts condition {\n if (!condition) {\n throw new Error(message);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,SAAgB,cAAiB,OAA6B,SAAqC;CACjG,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC9B,MAAM,IAAI,MAAM,OAAO;AAE3B;;;;;;;;;;;;AAaA,SAAgB,UAAU,WAAoB,SAAoC;CAChF,IAAI,CAAC,WACH,MAAM,IAAI,MAAM,OAAO;AAE3B"} | ||
| {"version":3,"file":"assertions.mjs","names":[],"sources":["../src/assertions.ts"],"sourcesContent":["import { InternalError } from './internal-error';\n\n/**\n * Asserts that a value is defined (not null or undefined).\n * Use for invariants where the value should always exist at runtime.\n *\n * @throws Error if value is null or undefined\n *\n * @example\n * ```typescript\n * const table = storage.namespaces[namespaceId].entries.table[tableName];\n * assertDefined(table, `Table \"${tableName}\" not found`);\n * // table is now narrowed to non-nullable\n * ```\n */\nexport function assertDefined<T>(value: T | null | undefined, message: string): asserts value is T {\n if (value === null || value === undefined) {\n throw new InternalError(message);\n }\n}\n\n/**\n * Asserts that a condition is true.\n * Use for invariants that should always hold at runtime.\n *\n * @throws Error if condition is false\n *\n * @example\n * ```typescript\n * invariant(columns.length > 0, 'Primary key must have at least one column');\n * ```\n */\nexport function invariant(condition: boolean, message: string): asserts condition {\n if (!condition) {\n throw new InternalError(message);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAgB,cAAiB,OAA6B,SAAqC;CACjG,IAAI,UAAU,QAAQ,UAAU,KAAA,GAC9B,MAAM,IAAI,cAAc,OAAO;AAEnC;;;;;;;;;;;;AAaA,SAAgB,UAAU,WAAoB,SAAoC;CAChF,IAAI,CAAC,WACH,MAAM,IAAI,cAAc,OAAO;AAEnC"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"canonical-stringify.d.mts","names":[],"sources":["../src/canonical-stringify.ts"],"mappings":";;AA6CA;;;;AAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAjC,kBAAA,CAAmB,KAAc"} | ||
| {"version":3,"file":"canonical-stringify.d.mts","names":[],"sources":["../src/canonical-stringify.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6CgB,mBAAmB"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"casts.d.mts","names":[],"sources":["../src/casts.ts"],"mappings":";;AAmCA;;;;;;;;;AAAyF;AA0CzF;;;;;;;;;AAA+C;;;;;;;;;;;;;;;iBA1C/B,SAAA,qCAA8C,KAAA,YAAiB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0CzE,MAAA,OAAa,KAAA,EAAO,IAAA,GAAO,IAAI"} | ||
| {"version":3,"file":"casts.d.mts","names":[],"sources":["../src/casts.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmCgB,UAAU,YAAY,wBAAwB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0C/D,OAAO,MAAM,OAAO,OAAO"} |
@@ -24,5 +24,5 @@ //#region src/defined.d.ts | ||
| */ | ||
| declare function ifDefined<K extends string, V>(key: K, value: V | undefined): Record<never, never> | { [P in K]: V }; | ||
| declare function ifDefined<K extends string, V>(key: K, value: V | undefined): Record<never, never> | { [P in K]: V; }; | ||
| //#endregion | ||
| export { ifDefined }; | ||
| //# sourceMappingURL=defined.d.mts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"defined.d.mts","names":[],"sources":["../src/defined.ts"],"mappings":";;AAwBA;;;;;;;;;;;;;;;;;;;;;iBAAgB,SAAA,sBACd,GAAA,EAAK,CAAA,EACL,KAAA,EAAO,CAAA,eACN,MAAA,yBAA+B,CAAA,GAAI,CAAA"} | ||
| {"version":3,"file":"defined.d.mts","names":[],"sources":["../src/defined.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBAwBgB,UAAU,kBAAkB,GAC1C,KAAK,GACL,OAAO,gBACN,0BAA0B,KAAK,IAAI"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"hash-content.d.mts","names":[],"sources":["../src/hash-content.ts"],"mappings":";;AAqDA;;;;AAAyD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAnC,WAAA,CAAY,KAAA,WAAgB,OAAO"} | ||
| {"version":3,"file":"hash-content.d.mts","names":[],"sources":["../src/hash-content.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqDsB,YAAY,gBAAgB"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"json.d.mts","names":[],"sources":["../src/json.ts"],"mappings":";;AAgBA;;;;AAAyB;AAEzB;;;;AAA0C;AAE1C;;;;KAJY,aAAA;AAAA,KAEA,SAAA,YAAqB,SAAS;AAAA,KAE9B,UAAA;EAAA,UAAyB,GAAA,WAAc,SAAS;AAAA;AAAA,KAEhD,SAAA,GAAY,aAAA,GAAgB,SAAA,GAAY,UAAA"} | ||
| {"version":3,"file":"json.d.mts","names":[],"sources":["../src/json.ts"],"mappings":";;;;;;;;;;;;;;;;KAgBY;KAEA,qBAAqB;KAErB;YAAyB,cAAc;;KAEvC,YAAY,gBAAgB,YAAY"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"promise.d.mts","names":[],"sources":["../src/promise.ts"],"mappings":";;AAKA;;;;iBAAgB,UAAA,IAAc,KAAA,EAAO,CAAA,GAAI,WAAA,CAAY,CAAA,IAAK,KAAA,IAAS,WAAA,CAAY,CAAA"} | ||
| {"version":3,"file":"promise.d.mts","names":[],"sources":["../src/promise.ts"],"mappings":";;;;;;iBAKgB,WAAW,GAAG,OAAO,IAAI,YAAY,KAAK,SAAS,YAAY"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"redact-db-url.d.mts","names":[],"sources":["../src/redact-db-url.ts"],"mappings":";;AAMA;;;UAAiB,mBAAA;EAAA,SACN,IAAA;EAAA,SACA,IAAA;EAAA,SACA,QAAA;EAAA,SACA,QAAA;AAAA;AAAQ;AASnB;;;;AAAmE;AAThD,iBASH,iBAAA,CAAkB,GAAA,WAAc,mBAAmB"} | ||
| {"version":3,"file":"redact-db-url.d.mts","names":[],"sources":["../src/redact-db-url.ts"],"mappings":";;;;;UAMiB;WACN;WACA;WACA;WACA;;;;;;;;iBASK,kBAAkB,cAAc"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"result.d.mts","names":[],"sources":["../src/result.ts"],"mappings":";;AAiBA;;;;;;;;;;;;AAIa;UAJI,EAAA;EAAA,SACN,EAAA;EAAA,SACA,KAAA,EAAO,CAAA;EAChB,QAAA,IAAY,CAAC;EACb,WAAA;AAAA;;;;UAMe,KAAA;EAAA,SACN,EAAA;EAAA,SACA,OAAA,EAAS,CAAA;EAClB,QAAA;EACA,WAAA,IAAe,CAAC;AAAA;;;;;;;KASN,MAAA,SAAe,EAAA,CAAG,CAAA,IAAK,KAAA,CAAM,CAAA;;;;iBAkFzB,EAAA,IAAM,KAAA,EAAO,CAAA,GAAI,EAAA,CAAG,CAAA;;;;iBAOpB,KAAA,IAAS,OAAA,EAAS,CAAA,GAAI,KAAA,CAAM,CAAA;AAP5C;;;;AAAA,iBAqBgB,MAAA,IAAU,EAAE"} | ||
| {"version":3,"file":"result.d.mts","names":[],"sources":["../src/result.ts"],"mappings":";;;;;;;;;;;;;;;UAiBiB,GAAG;WACT;WACA,OAAO;EAChB,YAAY;EACZ;;;;;UAMe,MAAM;WACZ;WACA,SAAS;EAClB;EACA,eAAe;;;;;;;;KASL,OAAO,GAAG,KAAK,GAAG,KAAK,MAAM;;;;iBAkFzB,GAAG,GAAG,OAAO,IAAI,GAAG;;;;iBAOpB,MAAM,GAAG,SAAS,IAAI,MAAM;;;;;iBAc5B,UAAU"} |
| //#region src/simplify-deep.d.ts | ||
| type SimplifyDeep<T> = T extends readonly (infer Element)[] ? T extends unknown[] ? SimplifyDeep<Element>[] : readonly SimplifyDeep<Element>[] : T extends string | number | boolean | bigint | symbol | Date | RegExp | Uint8Array | ((...args: never[]) => unknown) ? T : T extends object ? { [K in keyof T]: SimplifyDeep<T[K]> } : T; | ||
| type SimplifyDeep<T> = T extends readonly (infer Element)[] ? T extends unknown[] ? SimplifyDeep<Element>[] : readonly SimplifyDeep<Element>[] : T extends string | number | boolean | bigint | symbol | Date | RegExp | Uint8Array | ((...args: never[]) => unknown) ? T : T extends object ? { [K in keyof T]: SimplifyDeep<T[K]>; } : T; | ||
| //#endregion | ||
| export type { SimplifyDeep }; | ||
| //# sourceMappingURL=simplify-deep.d.mts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"simplify-deep.d.mts","names":[],"sources":["../src/simplify-deep.ts"],"mappings":";KAAY,YAAA,MAAkB,CAAA,sCAC1B,CAAA,qBACE,YAAA,CAAa,OAAA,eACJ,YAAA,CAAa,OAAA,MACxB,CAAA,uDAMM,IAAA,GACA,MAAA,GACA,UAAA,QACK,IAAA,yBACT,CAAA,GACA,CAAA,gCACgB,CAAA,GAAI,YAAA,CAAa,CAAA,CAAE,CAAA,OACjC,CAAA"} | ||
| {"version":3,"file":"simplify-deep.d.mts","names":[],"sources":["../src/simplify-deep.ts"],"mappings":";KAAY,aAAa,KAAK,0BAA0B,aACpD,sBACE,aAAa,sBACJ,aAAa,aACxB,wDAMM,OACA,SACA,kBACK,6BACT,IACA,sBACK,WAAW,IAAI,aAAa,EAAE,SACjC"} |
+1
-1
| //#region src/types.d.ts | ||
| type Simplify<T> = { [K in keyof T]: T[K] } & {}; | ||
| type Simplify<T> = { [K in keyof T]: T[K]; } & {}; | ||
| type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; | ||
@@ -4,0 +4,0 @@ //#endregion |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";KAAY,QAAA,oBAA4B,CAAA,GAAI,CAAA,CAAE,CAAA;AAAA,KAElC,mBAAA,OAA0B,CAAA,oBAAqB,CAAA,EAAG,CAAC,6BAC7D,CAAA,sBAEE,CAAA"} | ||
| {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";KAAY,SAAS,QAAQ,WAAW,IAAI,EAAE;KAElC,oBAAoB,MAAM,qBAAqB,GAAG,8BAC5D,SAAS,cAEP"} |
+6
-4
| { | ||
| "name": "@prisma-next/utils", | ||
| "version": "0.15.0", | ||
| "version": "0.16.0-dev.2", | ||
| "license": "Apache-2.0", | ||
@@ -9,5 +9,5 @@ "type": "module", | ||
| "devDependencies": { | ||
| "@prisma-next/tsconfig": "0.15.0", | ||
| "@prisma-next/tsdown": "0.15.0", | ||
| "tsdown": "0.22.3", | ||
| "@prisma-next/tsconfig": "0.16.0-dev.2", | ||
| "@prisma-next/tsdown": "0.16.0-dev.2", | ||
| "tsdown": "0.22.8", | ||
| "typescript": "5.9.3", | ||
@@ -36,2 +36,3 @@ "vitest": "4.1.10" | ||
| "./hash-content": "./dist/hash-content.mjs", | ||
| "./internal-error": "./dist/internal-error.mjs", | ||
| "./json": "./dist/json.mjs", | ||
@@ -42,2 +43,3 @@ "./promise": "./dist/promise.mjs", | ||
| "./simplify-deep": "./dist/simplify-deep.mjs", | ||
| "./structured-error": "./dist/structured-error.mjs", | ||
| "./types": "./dist/types.mjs", | ||
@@ -44,0 +46,0 @@ "./package.json": "./package.json" |
@@ -0,1 +1,3 @@ | ||
| import { InternalError } from './internal-error'; | ||
| /** | ||
@@ -16,3 +18,3 @@ * Asserts that a value is defined (not null or undefined). | ||
| if (value === null || value === undefined) { | ||
| throw new Error(message); | ||
| throw new InternalError(message); | ||
| } | ||
@@ -34,4 +36,4 @@ } | ||
| if (!condition) { | ||
| throw new Error(message); | ||
| throw new InternalError(message); | ||
| } | ||
| } |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
118133
11.27%93
16.25%1288
12.59%1
Infinity%