@visulima/prisma-dmmf-transformer 2.0.27 → 2.0.29

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/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## @visulima/prisma-dmmf-transformer [2.0.29](https://github.com/visulima/visulima/compare/@visulima/prisma-dmmf-transformer@2.0.28...@visulima/prisma-dmmf-transformer@2.0.29) (2025-05-30)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **prisma-dmmf-transformer:** update dependencies ([9768f55](https://github.com/visulima/visulima/commit/9768f559897983b4d6ba2c4ebb515659c7c07342))
6
+ * **prisma-dmmf-transformer:** update license information and add type-fest dependency ([ef59af8](https://github.com/visulima/visulima/commit/ef59af88b0d4fcbc3dc6aed7853ce5ba7f464d7c))
7
+
8
+ ### Miscellaneous Chores
9
+
10
+ * updated dev dependencies ([2433ed5](https://github.com/visulima/visulima/commit/2433ed5fb662e0303c37edee8ddc21b46c21263f))
11
+
12
+ ## @visulima/prisma-dmmf-transformer [2.0.28](https://github.com/visulima/visulima/compare/@visulima/prisma-dmmf-transformer@2.0.27...@visulima/prisma-dmmf-transformer@2.0.28) (2025-03-07)
13
+
14
+ ### Bug Fixes
15
+
16
+ * updated @visulima/packem and other dev deps, for better bundling size ([e940581](https://github.com/visulima/visulima/commit/e9405812201594e54dd81d17ddb74177df5f3c24))
17
+
1
18
  ## @visulima/prisma-dmmf-transformer [2.0.27](https://github.com/visulima/visulima/compare/@visulima/prisma-dmmf-transformer@2.0.26...@visulima/prisma-dmmf-transformer@2.0.27) (2025-02-28)
2
19
 
3
20
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -27,7 +27,7 @@ SOFTWARE.
27
27
 
28
28
  # Licenses of bundled types
29
29
  The published @visulima/prisma-dmmf-transformer artifact additionally contains code with the following licenses:
30
- MIT
30
+ MIT, (MIT OR CC0-1.0)
31
31
 
32
32
  # Bundled types:
33
33
  ## @types/json-schema
@@ -57,4 +57,133 @@ Repository: https://github.com/DefinitelyTyped/DefinitelyTyped.git
57
57
  > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
58
58
  > SOFTWARE
59
59
 
60
+ ---------------------------------------
61
+
62
+ ## type-fest
63
+ License: (MIT OR CC0-1.0)
64
+ By: Sindre Sorhus
65
+ Repository: sindresorhus/type-fest
66
+
67
+ > Creative Commons Legal Code
68
+ >
69
+ > CC0 1.0 Universal
70
+ >
71
+ > CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
72
+ > LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
73
+ > ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
74
+ > INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
75
+ > REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
76
+ > PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
77
+ > THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
78
+ > HEREUNDER.
79
+ >
80
+ > Statement of Purpose
81
+ >
82
+ > The laws of most jurisdictions throughout the world automatically confer
83
+ > exclusive Copyright and Related Rights (defined below) upon the creator
84
+ > and subsequent owner(s) (each and all, an "owner") of an original work of
85
+ > authorship and/or a database (each, a "Work").
86
+ >
87
+ > Certain owners wish to permanently relinquish those rights to a Work for
88
+ > the purpose of contributing to a commons of creative, cultural and
89
+ > scientific works ("Commons") that the public can reliably and without fear
90
+ > of later claims of infringement build upon, modify, incorporate in other
91
+ > works, reuse and redistribute as freely as possible in any form whatsoever
92
+ > and for any purposes, including without limitation commercial purposes.
93
+ > These owners may contribute to the Commons to promote the ideal of a free
94
+ > culture and the further production of creative, cultural and scientific
95
+ > works, or to gain reputation or greater distribution for their Work in
96
+ > part through the use and efforts of others.
97
+ >
98
+ > For these and/or other purposes and motivations, and without any
99
+ > expectation of additional consideration or compensation, the person
100
+ > associating CC0 with a Work (the "Affirmer"), to the extent that he or she
101
+ > is an owner of Copyright and Related Rights in the Work, voluntarily
102
+ > elects to apply CC0 to the Work and publicly distribute the Work under its
103
+ > terms, with knowledge of his or her Copyright and Related Rights in the
104
+ > Work and the meaning and intended legal effect of CC0 on those rights.
105
+ >
106
+ > 1. Copyright and Related Rights. A Work made available under CC0 may be
107
+ > protected by copyright and related or neighboring rights ("Copyright and
108
+ > Related Rights"). Copyright and Related Rights include, but are not
109
+ > limited to, the following:
110
+ >
111
+ > i. the right to reproduce, adapt, distribute, perform, display,
112
+ > communicate, and translate a Work;
113
+ > ii. moral rights retained by the original author(s) and/or performer(s);
114
+ > iii. publicity and privacy rights pertaining to a person's image or
115
+ > likeness depicted in a Work;
116
+ > iv. rights protecting against unfair competition in regards to a Work,
117
+ > subject to the limitations in paragraph 4(a), below;
118
+ > v. rights protecting the extraction, dissemination, use and reuse of data
119
+ > in a Work;
120
+ > vi. database rights (such as those arising under Directive 96/9/EC of the
121
+ > European Parliament and of the Council of 11 March 1996 on the legal
122
+ > protection of databases, and under any national implementation
123
+ > thereof, including any amended or successor version of such
124
+ > directive); and
125
+ > vii. other similar, equivalent or corresponding rights throughout the
126
+ > world based on applicable law or treaty, and any national
127
+ > implementations thereof.
128
+ >
129
+ > 2. Waiver. To the greatest extent permitted by, but not in contravention
130
+ > of, applicable law, Affirmer hereby overtly, fully, permanently,
131
+ > irrevocably and unconditionally waives, abandons, and surrenders all of
132
+ > Affirmer's Copyright and Related Rights and associated claims and causes
133
+ > of action, whether now known or unknown (including existing as well as
134
+ > future claims and causes of action), in the Work (i) in all territories
135
+ > worldwide, (ii) for the maximum duration provided by applicable law or
136
+ > treaty (including future time extensions), (iii) in any current or future
137
+ > medium and for any number of copies, and (iv) for any purpose whatsoever,
138
+ > including without limitation commercial, advertising or promotional
139
+ > purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
140
+ > member of the public at large and to the detriment of Affirmer's heirs and
141
+ > successors, fully intending that such Waiver shall not be subject to
142
+ > revocation, rescission, cancellation, termination, or any other legal or
143
+ > equitable action to disrupt the quiet enjoyment of the Work by the public
144
+ > as contemplated by Affirmer's express Statement of Purpose.
145
+ >
146
+ > 3. Public License Fallback. Should any part of the Waiver for any reason
147
+ > be judged legally invalid or ineffective under applicable law, then the
148
+ > Waiver shall be preserved to the maximum extent permitted taking into
149
+ > account Affirmer's express Statement of Purpose. In addition, to the
150
+ > extent the Waiver is so judged Affirmer hereby grants to each affected
151
+ > person a royalty-free, non transferable, non sublicensable, non exclusive,
152
+ > irrevocable and unconditional license to exercise Affirmer's Copyright and
153
+ > Related Rights in the Work (i) in all territories worldwide, (ii) for the
154
+ > maximum duration provided by applicable law or treaty (including future
155
+ > time extensions), (iii) in any current or future medium and for any number
156
+ > of copies, and (iv) for any purpose whatsoever, including without
157
+ > limitation commercial, advertising or promotional purposes (the
158
+ > "License"). The License shall be deemed effective as of the date CC0 was
159
+ > applied by Affirmer to the Work. Should any part of the License for any
160
+ > reason be judged legally invalid or ineffective under applicable law, such
161
+ > partial invalidity or ineffectiveness shall not invalidate the remainder
162
+ > of the License, and in such case Affirmer hereby affirms that he or she
163
+ > will not (i) exercise any of his or her remaining Copyright and Related
164
+ > Rights in the Work or (ii) assert any associated claims and causes of
165
+ > action with respect to the Work, in either case contrary to Affirmer's
166
+ > express Statement of Purpose.
167
+ >
168
+ > 4. Limitations and Disclaimers.
169
+ >
170
+ > a. No trademark or patent rights held by Affirmer are waived, abandoned,
171
+ > surrendered, licensed or otherwise affected by this document.
172
+ > b. Affirmer offers the Work as-is and makes no representations or
173
+ > warranties of any kind concerning the Work, express, implied,
174
+ > statutory or otherwise, including without limitation warranties of
175
+ > title, merchantability, fitness for a particular purpose, non
176
+ > infringement, or the absence of latent or other defects, accuracy, or
177
+ > the present or absence of errors, whether or not discoverable, all to
178
+ > the greatest extent permissible under applicable law.
179
+ > c. Affirmer disclaims responsibility for clearing rights of other persons
180
+ > that may apply to the Work or any use thereof, including without
181
+ > limitation any person's Copyright and Related Rights in the Work.
182
+ > Further, Affirmer disclaims responsibility for obtaining any necessary
183
+ > consents, permissions or other rights required for any use of the
184
+ > Work.
185
+ > d. Affirmer understands and acknowledges that Creative Commons is not a
186
+ > party to this document and has no duty or obligation with respect to
187
+ > this CC0 or use of the Work.
188
+
60
189
  <!-- /TYPE_DEPENDENCIES -->
package/dist/index.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
4
 
5
- const getJSONSchemaProperty = require('./packem_shared/getJSONSchemaProperty-CQOx1F3i.cjs');
6
- const transformDMMF = require('./packem_shared/transformDMMF-DsOUjIEw.cjs');
5
+ const getJSONSchemaProperty = require('./packem_shared/getJSONSchemaProperty-Ul9ZXvbT.cjs');
6
+ const transformDMMF = require('./packem_shared/transformDMMF-BlrIBvPS.cjs');
7
7
 
8
8
 
9
9
 
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReadonlyDeep, DMMF } from '@prisma/generator-helper';
1
+ import { DMMF } from '@prisma/generator-helper';
2
2
 
3
3
  // ==================================================================================================
4
4
  // JSON Schema Draft 07
@@ -167,6 +167,129 @@ interface JSONSchema7 {
167
167
  examples?: JSONSchema7Type | undefined;
168
168
  }
169
169
 
170
+ /**
171
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
172
+
173
+ @category Type
174
+ */
175
+ type Primitive =
176
+ | null
177
+ | undefined
178
+ | string
179
+ | number
180
+ | boolean
181
+ | symbol
182
+ | bigint;
183
+
184
+ declare global {
185
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
186
+ interface SymbolConstructor {
187
+ readonly observable: symbol;
188
+ }
189
+ }
190
+
191
+ /**
192
+ Matches any primitive, `void`, `Date`, or `RegExp` value.
193
+ */
194
+ type BuiltIns = Primitive | void | Date | RegExp;
195
+
196
+ /**
197
+ Test if the given function has multiple call signatures.
198
+
199
+ Needed to handle the case of a single call signature with properties.
200
+
201
+ Multiple call signatures cannot currently be supported due to a TypeScript limitation.
202
+ @see https://github.com/microsoft/TypeScript/issues/29732
203
+ */
204
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> =
205
+ T extends {(...arguments_: infer A): unknown; (...arguments_: infer B): unknown}
206
+ ? B extends A
207
+ ? A extends B
208
+ ? false
209
+ : true
210
+ : true
211
+ : false;
212
+
213
+ /**
214
+ Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively.
215
+
216
+ This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around.
217
+
218
+ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript.
219
+
220
+ @example
221
+ ```
222
+ // data.json
223
+ {
224
+ "foo": ["bar"]
225
+ }
226
+
227
+ // main.ts
228
+ import type {ReadonlyDeep} from 'type-fest';
229
+ import dataJson = require('./data.json');
230
+
231
+ const data: ReadonlyDeep<typeof dataJson> = dataJson;
232
+
233
+ export default data;
234
+
235
+ // test.ts
236
+ import data from './main';
237
+
238
+ data.foo.push('bar');
239
+ //=> error TS2339: Property 'push' does not exist on type 'readonly string[]'
240
+ ```
241
+
242
+ Note that types containing overloaded functions are not made deeply readonly due to a [TypeScript limitation](https://github.com/microsoft/TypeScript/issues/29732).
243
+
244
+ @category Object
245
+ @category Array
246
+ @category Set
247
+ @category Map
248
+ */
249
+ type ReadonlyDeep<T> = T extends BuiltIns
250
+ ? T
251
+ : T extends new (...arguments_: any[]) => unknown
252
+ ? T // Skip class constructors
253
+ : T extends (...arguments_: any[]) => unknown
254
+ ? {} extends ReadonlyObjectDeep<T>
255
+ ? T
256
+ : HasMultipleCallSignatures<T> extends true
257
+ ? T
258
+ : ((...arguments_: Parameters<T>) => ReturnType<T>) & ReadonlyObjectDeep<T>
259
+ : T extends Readonly<ReadonlyMap<infer KeyType, infer ValueType>>
260
+ ? ReadonlyMapDeep<KeyType, ValueType>
261
+ : T extends Readonly<ReadonlySet<infer ItemType>>
262
+ ? ReadonlySetDeep<ItemType>
263
+ : // Identify tuples to avoid converting them to arrays inadvertently; special case `readonly [...never[]]`, as it emerges undesirably from recursive invocations of ReadonlyDeep below.
264
+ T extends readonly [] | readonly [...never[]]
265
+ ? readonly []
266
+ : T extends readonly [infer U, ...infer V]
267
+ ? readonly [ReadonlyDeep<U>, ...ReadonlyDeep<V>]
268
+ : T extends readonly [...infer U, infer V]
269
+ ? readonly [...ReadonlyDeep<U>, ReadonlyDeep<V>]
270
+ : T extends ReadonlyArray<infer ItemType>
271
+ ? ReadonlyArray<ReadonlyDeep<ItemType>>
272
+ : T extends object
273
+ ? ReadonlyObjectDeep<T>
274
+ : unknown;
275
+
276
+ /**
277
+ Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`.
278
+ */
279
+ type ReadonlyMapDeep<KeyType, ValueType> = {} & Readonly<ReadonlyMap<ReadonlyDeep<KeyType>, ReadonlyDeep<ValueType>>>;
280
+
281
+ /**
282
+ Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`.
283
+ */
284
+ type ReadonlySetDeep<ItemType> = {} & Readonly<ReadonlySet<ReadonlyDeep<ItemType>>>;
285
+
286
+ /**
287
+ Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`.
288
+ */
289
+ type ReadonlyObjectDeep<ObjectType extends object> = {
290
+ readonly [KeyType in keyof ObjectType]: ReadonlyDeep<ObjectType[KeyType]>
291
+ };
292
+
170
293
  interface PropertyMetaData {
171
294
  hasDefaultValue: boolean;
172
295
  isScalar: boolean;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReadonlyDeep, DMMF } from '@prisma/generator-helper';
1
+ import { DMMF } from '@prisma/generator-helper';
2
2
 
3
3
  // ==================================================================================================
4
4
  // JSON Schema Draft 07
@@ -167,6 +167,129 @@ interface JSONSchema7 {
167
167
  examples?: JSONSchema7Type | undefined;
168
168
  }
169
169
 
170
+ /**
171
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
172
+
173
+ @category Type
174
+ */
175
+ type Primitive =
176
+ | null
177
+ | undefined
178
+ | string
179
+ | number
180
+ | boolean
181
+ | symbol
182
+ | bigint;
183
+
184
+ declare global {
185
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
186
+ interface SymbolConstructor {
187
+ readonly observable: symbol;
188
+ }
189
+ }
190
+
191
+ /**
192
+ Matches any primitive, `void`, `Date`, or `RegExp` value.
193
+ */
194
+ type BuiltIns = Primitive | void | Date | RegExp;
195
+
196
+ /**
197
+ Test if the given function has multiple call signatures.
198
+
199
+ Needed to handle the case of a single call signature with properties.
200
+
201
+ Multiple call signatures cannot currently be supported due to a TypeScript limitation.
202
+ @see https://github.com/microsoft/TypeScript/issues/29732
203
+ */
204
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> =
205
+ T extends {(...arguments_: infer A): unknown; (...arguments_: infer B): unknown}
206
+ ? B extends A
207
+ ? A extends B
208
+ ? false
209
+ : true
210
+ : true
211
+ : false;
212
+
213
+ /**
214
+ Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively.
215
+
216
+ This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around.
217
+
218
+ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript.
219
+
220
+ @example
221
+ ```
222
+ // data.json
223
+ {
224
+ "foo": ["bar"]
225
+ }
226
+
227
+ // main.ts
228
+ import type {ReadonlyDeep} from 'type-fest';
229
+ import dataJson = require('./data.json');
230
+
231
+ const data: ReadonlyDeep<typeof dataJson> = dataJson;
232
+
233
+ export default data;
234
+
235
+ // test.ts
236
+ import data from './main';
237
+
238
+ data.foo.push('bar');
239
+ //=> error TS2339: Property 'push' does not exist on type 'readonly string[]'
240
+ ```
241
+
242
+ Note that types containing overloaded functions are not made deeply readonly due to a [TypeScript limitation](https://github.com/microsoft/TypeScript/issues/29732).
243
+
244
+ @category Object
245
+ @category Array
246
+ @category Set
247
+ @category Map
248
+ */
249
+ type ReadonlyDeep<T> = T extends BuiltIns
250
+ ? T
251
+ : T extends new (...arguments_: any[]) => unknown
252
+ ? T // Skip class constructors
253
+ : T extends (...arguments_: any[]) => unknown
254
+ ? {} extends ReadonlyObjectDeep<T>
255
+ ? T
256
+ : HasMultipleCallSignatures<T> extends true
257
+ ? T
258
+ : ((...arguments_: Parameters<T>) => ReturnType<T>) & ReadonlyObjectDeep<T>
259
+ : T extends Readonly<ReadonlyMap<infer KeyType, infer ValueType>>
260
+ ? ReadonlyMapDeep<KeyType, ValueType>
261
+ : T extends Readonly<ReadonlySet<infer ItemType>>
262
+ ? ReadonlySetDeep<ItemType>
263
+ : // Identify tuples to avoid converting them to arrays inadvertently; special case `readonly [...never[]]`, as it emerges undesirably from recursive invocations of ReadonlyDeep below.
264
+ T extends readonly [] | readonly [...never[]]
265
+ ? readonly []
266
+ : T extends readonly [infer U, ...infer V]
267
+ ? readonly [ReadonlyDeep<U>, ...ReadonlyDeep<V>]
268
+ : T extends readonly [...infer U, infer V]
269
+ ? readonly [...ReadonlyDeep<U>, ReadonlyDeep<V>]
270
+ : T extends ReadonlyArray<infer ItemType>
271
+ ? ReadonlyArray<ReadonlyDeep<ItemType>>
272
+ : T extends object
273
+ ? ReadonlyObjectDeep<T>
274
+ : unknown;
275
+
276
+ /**
277
+ Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`.
278
+ */
279
+ type ReadonlyMapDeep<KeyType, ValueType> = {} & Readonly<ReadonlyMap<ReadonlyDeep<KeyType>, ReadonlyDeep<ValueType>>>;
280
+
281
+ /**
282
+ Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`.
283
+ */
284
+ type ReadonlySetDeep<ItemType> = {} & Readonly<ReadonlySet<ReadonlyDeep<ItemType>>>;
285
+
286
+ /**
287
+ Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`.
288
+ */
289
+ type ReadonlyObjectDeep<ObjectType extends object> = {
290
+ readonly [KeyType in keyof ObjectType]: ReadonlyDeep<ObjectType[KeyType]>
291
+ };
292
+
170
293
  interface PropertyMetaData {
171
294
  hasDefaultValue: boolean;
172
295
  isScalar: boolean;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReadonlyDeep, DMMF } from '@prisma/generator-helper';
1
+ import { DMMF } from '@prisma/generator-helper';
2
2
 
3
3
  // ==================================================================================================
4
4
  // JSON Schema Draft 07
@@ -167,6 +167,129 @@ interface JSONSchema7 {
167
167
  examples?: JSONSchema7Type | undefined;
168
168
  }
169
169
 
170
+ /**
171
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
172
+
173
+ @category Type
174
+ */
175
+ type Primitive =
176
+ | null
177
+ | undefined
178
+ | string
179
+ | number
180
+ | boolean
181
+ | symbol
182
+ | bigint;
183
+
184
+ declare global {
185
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
186
+ interface SymbolConstructor {
187
+ readonly observable: symbol;
188
+ }
189
+ }
190
+
191
+ /**
192
+ Matches any primitive, `void`, `Date`, or `RegExp` value.
193
+ */
194
+ type BuiltIns = Primitive | void | Date | RegExp;
195
+
196
+ /**
197
+ Test if the given function has multiple call signatures.
198
+
199
+ Needed to handle the case of a single call signature with properties.
200
+
201
+ Multiple call signatures cannot currently be supported due to a TypeScript limitation.
202
+ @see https://github.com/microsoft/TypeScript/issues/29732
203
+ */
204
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> =
205
+ T extends {(...arguments_: infer A): unknown; (...arguments_: infer B): unknown}
206
+ ? B extends A
207
+ ? A extends B
208
+ ? false
209
+ : true
210
+ : true
211
+ : false;
212
+
213
+ /**
214
+ Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively.
215
+
216
+ This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around.
217
+
218
+ Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript.
219
+
220
+ @example
221
+ ```
222
+ // data.json
223
+ {
224
+ "foo": ["bar"]
225
+ }
226
+
227
+ // main.ts
228
+ import type {ReadonlyDeep} from 'type-fest';
229
+ import dataJson = require('./data.json');
230
+
231
+ const data: ReadonlyDeep<typeof dataJson> = dataJson;
232
+
233
+ export default data;
234
+
235
+ // test.ts
236
+ import data from './main';
237
+
238
+ data.foo.push('bar');
239
+ //=> error TS2339: Property 'push' does not exist on type 'readonly string[]'
240
+ ```
241
+
242
+ Note that types containing overloaded functions are not made deeply readonly due to a [TypeScript limitation](https://github.com/microsoft/TypeScript/issues/29732).
243
+
244
+ @category Object
245
+ @category Array
246
+ @category Set
247
+ @category Map
248
+ */
249
+ type ReadonlyDeep<T> = T extends BuiltIns
250
+ ? T
251
+ : T extends new (...arguments_: any[]) => unknown
252
+ ? T // Skip class constructors
253
+ : T extends (...arguments_: any[]) => unknown
254
+ ? {} extends ReadonlyObjectDeep<T>
255
+ ? T
256
+ : HasMultipleCallSignatures<T> extends true
257
+ ? T
258
+ : ((...arguments_: Parameters<T>) => ReturnType<T>) & ReadonlyObjectDeep<T>
259
+ : T extends Readonly<ReadonlyMap<infer KeyType, infer ValueType>>
260
+ ? ReadonlyMapDeep<KeyType, ValueType>
261
+ : T extends Readonly<ReadonlySet<infer ItemType>>
262
+ ? ReadonlySetDeep<ItemType>
263
+ : // Identify tuples to avoid converting them to arrays inadvertently; special case `readonly [...never[]]`, as it emerges undesirably from recursive invocations of ReadonlyDeep below.
264
+ T extends readonly [] | readonly [...never[]]
265
+ ? readonly []
266
+ : T extends readonly [infer U, ...infer V]
267
+ ? readonly [ReadonlyDeep<U>, ...ReadonlyDeep<V>]
268
+ : T extends readonly [...infer U, infer V]
269
+ ? readonly [...ReadonlyDeep<U>, ReadonlyDeep<V>]
270
+ : T extends ReadonlyArray<infer ItemType>
271
+ ? ReadonlyArray<ReadonlyDeep<ItemType>>
272
+ : T extends object
273
+ ? ReadonlyObjectDeep<T>
274
+ : unknown;
275
+
276
+ /**
277
+ Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`.
278
+ */
279
+ type ReadonlyMapDeep<KeyType, ValueType> = {} & Readonly<ReadonlyMap<ReadonlyDeep<KeyType>, ReadonlyDeep<ValueType>>>;
280
+
281
+ /**
282
+ Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`.
283
+ */
284
+ type ReadonlySetDeep<ItemType> = {} & Readonly<ReadonlySet<ReadonlyDeep<ItemType>>>;
285
+
286
+ /**
287
+ Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`.
288
+ */
289
+ type ReadonlyObjectDeep<ObjectType extends object> = {
290
+ readonly [KeyType in keyof ObjectType]: ReadonlyDeep<ObjectType[KeyType]>
291
+ };
292
+
170
293
  interface PropertyMetaData {
171
294
  hasDefaultValue: boolean;
172
295
  isScalar: boolean;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { default as getJSONSchemaProperty } from './packem_shared/getJSONSchemaProperty-DzE_Iliv.mjs';
2
- export { default as transformDMMF } from './packem_shared/transformDMMF-DScJsLwJ.mjs';
1
+ export { default as getJSONSchemaProperty } from './packem_shared/getJSONSchemaProperty-CCMlB6rF.mjs';
2
+ export { default as transformDMMF } from './packem_shared/transformDMMF-BtZz70Wg.mjs';
@@ -2,7 +2,7 @@ import assert from 'node:assert';
2
2
 
3
3
  var __defProp = Object.defineProperty;
4
4
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- const isDefined = /* @__PURE__ */ __name((value) => value !== undefined && value !== null, "isDefined");
5
+ const isDefined = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null, "isDefined");
6
6
  const getJSONSchemaScalar = /* @__PURE__ */ __name((fieldType) => {
7
7
  switch (fieldType) {
8
8
  case "Int":
@@ -86,7 +86,7 @@ const getFormatByDMMFType = /* @__PURE__ */ __name((fieldType) => {
86
86
  if (fieldType === "DateTime") {
87
87
  return "date-time";
88
88
  }
89
- return undefined;
89
+ return void 0;
90
90
  }, "getFormatByDMMFType");
91
91
  const getJSONSchemaForPropertyReference = /* @__PURE__ */ __name((field, { persistOriginalType, schemaId }) => {
92
92
  const notNullable = field.isRequired || field.isList;
@@ -102,7 +102,7 @@ const getJSONSchemaForPropertyReference = /* @__PURE__ */ __name((field, { persi
102
102
  }, "getJSONSchemaForPropertyReference");
103
103
  const getItemsByDMMFType = /* @__PURE__ */ __name((field, transformOptions) => {
104
104
  if (field.kind === "scalar" && !field.isList || field.kind === "enum") {
105
- return undefined;
105
+ return void 0;
106
106
  }
107
107
  if (field.kind === "scalar" && field.isList) {
108
108
  return { type: getJSONSchemaScalar(field.type) };
@@ -113,7 +113,7 @@ const isSingleReference = /* @__PURE__ */ __name((field) => field.kind !== "scal
113
113
  const getEnumListByDMMFType = /* @__PURE__ */ __name((modelMetaData) => (field) => {
114
114
  const enumItem = modelMetaData.enums.find(({ name }) => name === field.type);
115
115
  if (!enumItem) {
116
- return undefined;
116
+ return void 0;
117
117
  }
118
118
  return enumItem.values.map((item) => item.name);
119
119
  }, "getEnumListByDMMFType");
@@ -8,7 +8,7 @@ const assert__default = /*#__PURE__*/_interopDefaultCompat(assert);
8
8
 
9
9
  var __defProp = Object.defineProperty;
10
10
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
11
- const isDefined = /* @__PURE__ */ __name((value) => value !== undefined && value !== null, "isDefined");
11
+ const isDefined = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null, "isDefined");
12
12
  const getJSONSchemaScalar = /* @__PURE__ */ __name((fieldType) => {
13
13
  switch (fieldType) {
14
14
  case "Int":
@@ -92,7 +92,7 @@ const getFormatByDMMFType = /* @__PURE__ */ __name((fieldType) => {
92
92
  if (fieldType === "DateTime") {
93
93
  return "date-time";
94
94
  }
95
- return undefined;
95
+ return void 0;
96
96
  }, "getFormatByDMMFType");
97
97
  const getJSONSchemaForPropertyReference = /* @__PURE__ */ __name((field, { persistOriginalType, schemaId }) => {
98
98
  const notNullable = field.isRequired || field.isList;
@@ -108,7 +108,7 @@ const getJSONSchemaForPropertyReference = /* @__PURE__ */ __name((field, { persi
108
108
  }, "getJSONSchemaForPropertyReference");
109
109
  const getItemsByDMMFType = /* @__PURE__ */ __name((field, transformOptions) => {
110
110
  if (field.kind === "scalar" && !field.isList || field.kind === "enum") {
111
- return undefined;
111
+ return void 0;
112
112
  }
113
113
  if (field.kind === "scalar" && field.isList) {
114
114
  return { type: getJSONSchemaScalar(field.type) };
@@ -119,7 +119,7 @@ const isSingleReference = /* @__PURE__ */ __name((field) => field.kind !== "scal
119
119
  const getEnumListByDMMFType = /* @__PURE__ */ __name((modelMetaData) => (field) => {
120
120
  const enumItem = modelMetaData.enums.find(({ name }) => name === field.type);
121
121
  if (!enumItem) {
122
- return undefined;
122
+ return void 0;
123
123
  }
124
124
  return enumItem.values.map((item) => item.name);
125
125
  }, "getEnumListByDMMFType");
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const getJSONSchemaProperty = require('./getJSONSchemaProperty-CQOx1F3i.cjs');
3
+ const getJSONSchemaProperty = require('./getJSONSchemaProperty-Ul9ZXvbT.cjs');
4
4
 
5
5
  var __defProp$1 = Object.defineProperty;
6
6
  var __name$1 = (target, value) => __defProp$1(target, "name", { value, configurable: true });
@@ -1,4 +1,4 @@
1
- import getJSONSchemaProperty from './getJSONSchemaProperty-DzE_Iliv.mjs';
1
+ import getJSONSchemaProperty from './getJSONSchemaProperty-CCMlB6rF.mjs';
2
2
 
3
3
  var __defProp$1 = Object.defineProperty;
4
4
  var __name$1 = (target, value) => __defProp$1(target, "name", { value, configurable: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/prisma-dmmf-transformer",
3
- "version": "2.0.27",
3
+ "version": "2.0.29",
4
4
  "description": "A generator for Prisma to generate a valid JSON Schema v7.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -66,7 +66,7 @@
66
66
  "LICENSE.md"
67
67
  ],
68
68
  "dependencies": {
69
- "@prisma/generator-helper": "6.4.1"
69
+ "@prisma/generator-helper": "6.8.2"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@prisma/client": "3.* || 4.*",