@prisma/client-runtime-utils 7.5.0-dev.41 → 7.5.0-dev.43

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/dist/index.d.mts CHANGED
@@ -305,6 +305,15 @@ export declare function isDbNull(value: unknown): value is DbNullClass;
305
305
  */
306
306
  export declare function isJsonNull(value: unknown): value is JsonNullClass;
307
307
 
308
+ /**
309
+ * Check if a value is an ObjectEnumValue instance. Uses a global symbol
310
+ * instead of instanceof to work across bundle boundaries (e.g., when a
311
+ * Next.js app bundles browser and server code separately, creating duplicate
312
+ * module instances of @prisma/client-runtime-utils).
313
+ * See: https://github.com/prisma/prisma/issues/29257
314
+ */
315
+ export declare function isObjectEnumValue(value: unknown): value is ObjectEnumValue;
316
+
308
317
  /**
309
318
  * Create a SQL query for a list of values.
310
319
  */
@@ -344,6 +353,7 @@ declare class NullTypesEnumValue extends ObjectEnumValue {
344
353
  */
345
354
  export declare abstract class ObjectEnumValue {
346
355
  #private;
356
+ readonly [PRISMA_OBJECT_ENUM_VALUE] = true;
347
357
  constructor(arg?: symbol);
348
358
  abstract _getNamespace(): string;
349
359
  _getName(): string;
@@ -354,6 +364,15 @@ declare type Options = {
354
364
  clientVersion: string;
355
365
  };
356
366
 
367
+ /**
368
+ * Global symbol used to identify ObjectEnumValue instances across bundle
369
+ * boundaries. `Symbol.for()` returns the same symbol globally, so it works
370
+ * even when multiple copies of this module are loaded (e.g., browser and
371
+ * server bundles in Next.js, or HMR reloads).
372
+ * See: https://github.com/prisma/prisma/issues/29257
373
+ */
374
+ declare const PRISMA_OBJECT_ENUM_VALUE: unique symbol;
375
+
357
376
  export declare class PrismaClientInitializationError extends Error {
358
377
  clientVersion: string;
359
378
  errorCode?: string;
package/dist/index.d.ts CHANGED
@@ -305,6 +305,15 @@ export declare function isDbNull(value: unknown): value is DbNullClass;
305
305
  */
306
306
  export declare function isJsonNull(value: unknown): value is JsonNullClass;
307
307
 
308
+ /**
309
+ * Check if a value is an ObjectEnumValue instance. Uses a global symbol
310
+ * instead of instanceof to work across bundle boundaries (e.g., when a
311
+ * Next.js app bundles browser and server code separately, creating duplicate
312
+ * module instances of @prisma/client-runtime-utils).
313
+ * See: https://github.com/prisma/prisma/issues/29257
314
+ */
315
+ export declare function isObjectEnumValue(value: unknown): value is ObjectEnumValue;
316
+
308
317
  /**
309
318
  * Create a SQL query for a list of values.
310
319
  */
@@ -344,6 +353,7 @@ declare class NullTypesEnumValue extends ObjectEnumValue {
344
353
  */
345
354
  export declare abstract class ObjectEnumValue {
346
355
  #private;
356
+ readonly [PRISMA_OBJECT_ENUM_VALUE] = true;
347
357
  constructor(arg?: symbol);
348
358
  abstract _getNamespace(): string;
349
359
  _getName(): string;
@@ -354,6 +364,15 @@ declare type Options = {
354
364
  clientVersion: string;
355
365
  };
356
366
 
367
+ /**
368
+ * Global symbol used to identify ObjectEnumValue instances across bundle
369
+ * boundaries. `Symbol.for()` returns the same symbol globally, so it works
370
+ * even when multiple copies of this module are loaded (e.g., browser and
371
+ * server bundles in Next.js, or HMR reloads).
372
+ * See: https://github.com/prisma/prisma/issues/29257
373
+ */
374
+ declare const PRISMA_OBJECT_ENUM_VALUE: unique symbol;
375
+
357
376
  export declare class PrismaClientInitializationError extends Error {
358
377
  clientVersion: string;
359
378
  errorCode?: string;
package/dist/index.js CHANGED
@@ -41,6 +41,7 @@ __export(index_exports, {
41
41
  isAnyNull: () => isAnyNull,
42
42
  isDbNull: () => isDbNull,
43
43
  isJsonNull: () => isJsonNull,
44
+ isObjectEnumValue: () => isObjectEnumValue,
44
45
  join: () => join,
45
46
  raw: () => raw,
46
47
  sql: () => sql
@@ -196,7 +197,9 @@ setClassName(PrismaClientValidationError, "PrismaClientValidationError");
196
197
 
197
198
  // src/nullTypes.ts
198
199
  var secret = Symbol();
200
+ var PRISMA_OBJECT_ENUM_VALUE = Symbol.for("prisma.objectEnumValue");
199
201
  var ObjectEnumValue = class {
202
+ [PRISMA_OBJECT_ENUM_VALUE] = true;
200
203
  #representation;
201
204
  constructor(arg) {
202
205
  if (arg === secret) {
@@ -249,6 +252,9 @@ var NullTypes = {
249
252
  var DbNull = new DbNullClass(secret);
250
253
  var JsonNull = new JsonNullClass(secret);
251
254
  var AnyNull = new AnyNullClass(secret);
255
+ function isObjectEnumValue(value) {
256
+ return typeof value === "object" && value !== null && value[PRISMA_OBJECT_ENUM_VALUE] === true;
257
+ }
252
258
  function isDbNull(value) {
253
259
  return value === DbNull;
254
260
  }
@@ -2535,6 +2541,7 @@ function sql(strings, ...values) {
2535
2541
  isAnyNull,
2536
2542
  isDbNull,
2537
2543
  isJsonNull,
2544
+ isObjectEnumValue,
2538
2545
  join,
2539
2546
  raw,
2540
2547
  sql
package/dist/index.mjs CHANGED
@@ -147,7 +147,9 @@ setClassName(PrismaClientValidationError, "PrismaClientValidationError");
147
147
 
148
148
  // src/nullTypes.ts
149
149
  var secret = Symbol();
150
+ var PRISMA_OBJECT_ENUM_VALUE = Symbol.for("prisma.objectEnumValue");
150
151
  var ObjectEnumValue = class {
152
+ [PRISMA_OBJECT_ENUM_VALUE] = true;
151
153
  #representation;
152
154
  constructor(arg) {
153
155
  if (arg === secret) {
@@ -200,6 +202,9 @@ var NullTypes = {
200
202
  var DbNull = new DbNullClass(secret);
201
203
  var JsonNull = new JsonNullClass(secret);
202
204
  var AnyNull = new AnyNullClass(secret);
205
+ function isObjectEnumValue(value) {
206
+ return typeof value === "object" && value !== null && value[PRISMA_OBJECT_ENUM_VALUE] === true;
207
+ }
203
208
  function isDbNull(value) {
204
209
  return value === DbNull;
205
210
  }
@@ -2485,6 +2490,7 @@ export {
2485
2490
  isAnyNull,
2486
2491
  isDbNull,
2487
2492
  isJsonNull,
2493
+ isObjectEnumValue,
2488
2494
  join,
2489
2495
  raw,
2490
2496
  sql
@@ -1,8 +1,17 @@
1
+ /**
2
+ * Global symbol used to identify ObjectEnumValue instances across bundle
3
+ * boundaries. `Symbol.for()` returns the same symbol globally, so it works
4
+ * even when multiple copies of this module are loaded (e.g., browser and
5
+ * server bundles in Next.js, or HMR reloads).
6
+ * See: https://github.com/prisma/prisma/issues/29257
7
+ */
8
+ declare const PRISMA_OBJECT_ENUM_VALUE: unique symbol;
1
9
  /**
2
10
  * Base class for unique values of object-valued enums.
3
11
  */
4
12
  export declare abstract class ObjectEnumValue {
5
13
  #private;
14
+ readonly [PRISMA_OBJECT_ENUM_VALUE] = true;
6
15
  constructor(arg?: symbol);
7
16
  abstract _getNamespace(): string;
8
17
  _getName(): string;
@@ -28,6 +37,14 @@ export declare const NullTypes: {
28
37
  export declare const DbNull: DbNullClass;
29
38
  export declare const JsonNull: JsonNullClass;
30
39
  export declare const AnyNull: AnyNullClass;
40
+ /**
41
+ * Check if a value is an ObjectEnumValue instance. Uses a global symbol
42
+ * instead of instanceof to work across bundle boundaries (e.g., when a
43
+ * Next.js app bundles browser and server code separately, creating duplicate
44
+ * module instances of @prisma/client-runtime-utils).
45
+ * See: https://github.com/prisma/prisma/issues/29257
46
+ */
47
+ export declare function isObjectEnumValue(value: unknown): value is ObjectEnumValue;
31
48
  /**
32
49
  * Check if a value is the DBNull singleton instance.
33
50
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-runtime-utils",
3
- "version": "7.5.0-dev.41",
3
+ "version": "7.5.0-dev.43",
4
4
  "description": "Utility types and singletons used by the Prisma Client.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",