@prisma-next/utils 0.9.0 → 0.10.0-dev.10

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.
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @example
9
9
  * ```typescript
10
- * const table = storage.tables[tableName];
10
+ * const table = storage.namespaces[namespaceId].tables[tableName];
11
11
  * assertDefined(table, `Table "${tableName}" not found`);
12
12
  * // table is now narrowed to non-nullable
13
13
  * ```
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @example
9
9
  * ```typescript
10
- * const table = storage.tables[tableName];
10
+ * const table = storage.namespaces[namespaceId].tables[tableName];
11
11
  * assertDefined(table, `Table "${tableName}" not found`);
12
12
  * // table is now narrowed to non-nullable
13
13
  * ```
@@ -1 +1 @@
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.tables[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,QAAQ;;;;;;;;;;;;;AAe5B,SAAgB,UAAU,WAAoB,SAAoC;CAChF,IAAI,CAAC,WACH,MAAM,IAAI,MAAM,QAAQ"}
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].tables[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,QAAQ;;;;;;;;;;;;;AAe5B,SAAgB,UAAU,WAAoB,SAAoC;CAChF,IAAI,CAAC,WACH,MAAM,IAAI,MAAM,QAAQ"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@prisma-next/utils",
3
- "version": "0.9.0",
3
+ "version": "0.10.0-dev.10",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "Shared utility functions for Prisma Next",
8
8
  "devDependencies": {
9
- "@prisma-next/tsconfig": "0.9.0",
10
- "@prisma-next/tsdown": "0.9.0",
9
+ "@prisma-next/tsconfig": "0.10.0-dev.10",
10
+ "@prisma-next/tsdown": "0.10.0-dev.10",
11
11
  "tsdown": "0.22.0",
12
12
  "typescript": "5.9.3",
13
13
  "vitest": "4.1.6"
package/src/assertions.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @example
8
8
  * ```typescript
9
- * const table = storage.tables[tableName];
9
+ * const table = storage.namespaces[namespaceId].tables[tableName];
10
10
  * assertDefined(table, `Table "${tableName}" not found`);
11
11
  * // table is now narrowed to non-nullable
12
12
  * ```