@prisma/client-runtime-utils 7.5.0-dev.9 → 7.6.0-dev.1

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
  */
@@ -343,6 +352,8 @@ declare class NullTypesEnumValue extends ObjectEnumValue {
343
352
  * Base class for unique values of object-valued enums.
344
353
  */
345
354
  export declare abstract class ObjectEnumValue {
355
+ #private;
356
+ readonly [PRISMA_OBJECT_ENUM_VALUE] = true;
346
357
  constructor(arg?: symbol);
347
358
  abstract _getNamespace(): string;
348
359
  _getName(): string;
@@ -353,6 +364,15 @@ declare type Options = {
353
364
  clientVersion: string;
354
365
  };
355
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
+
356
376
  export declare class PrismaClientInitializationError extends Error {
357
377
  clientVersion: string;
358
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
  */
@@ -343,6 +352,8 @@ declare class NullTypesEnumValue extends ObjectEnumValue {
343
352
  * Base class for unique values of object-valued enums.
344
353
  */
345
354
  export declare abstract class ObjectEnumValue {
355
+ #private;
356
+ readonly [PRISMA_OBJECT_ENUM_VALUE] = true;
346
357
  constructor(arg?: symbol);
347
358
  abstract _getNamespace(): string;
348
359
  _getName(): string;
@@ -353,6 +364,15 @@ declare type Options = {
353
364
  clientVersion: string;
354
365
  };
355
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
+
356
376
  export declare class PrismaClientInitializationError extends Error {
357
377
  clientVersion: string;
358
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,20 +197,22 @@ setClassName(PrismaClientValidationError, "PrismaClientValidationError");
196
197
 
197
198
  // src/nullTypes.ts
198
199
  var secret = Symbol();
199
- var representations = /* @__PURE__ */ new WeakMap();
200
+ var PRISMA_OBJECT_ENUM_VALUE = Symbol.for("prisma.objectEnumValue");
200
201
  var ObjectEnumValue = class {
202
+ [PRISMA_OBJECT_ENUM_VALUE] = true;
203
+ #representation;
201
204
  constructor(arg) {
202
205
  if (arg === secret) {
203
- representations.set(this, `Prisma.${this._getName()}`);
206
+ this.#representation = `Prisma.${this._getName()}`;
204
207
  } else {
205
- representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`);
208
+ this.#representation = `new Prisma.${this._getNamespace()}.${this._getName()}()`;
206
209
  }
207
210
  }
208
211
  _getName() {
209
212
  return this.constructor.name;
210
213
  }
211
214
  toString() {
212
- return representations.get(this);
215
+ return this.#representation;
213
216
  }
214
217
  };
215
218
  function setClassName2(classObject, name) {
@@ -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,20 +147,22 @@ setClassName(PrismaClientValidationError, "PrismaClientValidationError");
147
147
 
148
148
  // src/nullTypes.ts
149
149
  var secret = Symbol();
150
- var representations = /* @__PURE__ */ new WeakMap();
150
+ var PRISMA_OBJECT_ENUM_VALUE = Symbol.for("prisma.objectEnumValue");
151
151
  var ObjectEnumValue = class {
152
+ [PRISMA_OBJECT_ENUM_VALUE] = true;
153
+ #representation;
152
154
  constructor(arg) {
153
155
  if (arg === secret) {
154
- representations.set(this, `Prisma.${this._getName()}`);
156
+ this.#representation = `Prisma.${this._getName()}`;
155
157
  } else {
156
- representations.set(this, `new Prisma.${this._getNamespace()}.${this._getName()}()`);
158
+ this.#representation = `new Prisma.${this._getNamespace()}.${this._getName()}()`;
157
159
  }
158
160
  }
159
161
  _getName() {
160
162
  return this.constructor.name;
161
163
  }
162
164
  toString() {
163
- return representations.get(this);
165
+ return this.#representation;
164
166
  }
165
167
  };
166
168
  function setClassName2(classObject, name) {
@@ -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,7 +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 {
13
+ #private;
14
+ readonly [PRISMA_OBJECT_ENUM_VALUE] = true;
5
15
  constructor(arg?: symbol);
6
16
  abstract _getNamespace(): string;
7
17
  _getName(): string;
@@ -27,6 +37,14 @@ export declare const NullTypes: {
27
37
  export declare const DbNull: DbNullClass;
28
38
  export declare const JsonNull: JsonNullClass;
29
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;
30
48
  /**
31
49
  * Check if a value is the DBNull singleton instance.
32
50
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-runtime-utils",
3
- "version": "7.5.0-dev.9",
3
+ "version": "7.6.0-dev.1",
4
4
  "description": "Utility types and singletons used by the Prisma Client.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",