Skip to content

Commit 87083c0

Browse files
authored
fix(enhancer): replace $Types.Skip with runtime.Types.Skip (#2242)
1 parent 8962ad9 commit 87083c0

File tree

1 file changed

+2
-2
lines changed
  • packages/schema/src/plugins/enhancer/enhance

1 file changed

+2
-2
lines changed

packages/schema/src/plugins/enhancer/enhance/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ export type Enhanced<Client> =
612612
throw new PluginError(name, `Unexpected syntax list structure in ${fileName}`);
613613
}
614614

615-
const statements: (string | StatementStructures)[] = ['import $Types = runtime.Types;'];
615+
const statements: (string | StatementStructures)[] = [];
616616

617617
// Add import for json-types if this model has JSON type fields
618618
const modelWithJsonFields = this.modelsWithJsonTypeFields.find((m) => m.name === d.name);
@@ -1032,7 +1032,7 @@ export type Enhanced<Client> =
10321032
// Check if the field in the source is optional (has a `?`)
10331033
const isOptionalInSource = new RegExp(`(${field.name}\\?\\s*):`).test(source);
10341034
if (isOptionalInSource) {
1035-
replaceValue += ' | $Types.Skip';
1035+
replaceValue += ' | runtime.Types.Skip';
10361036
}
10371037

10381038
return source.replace(new RegExp(`(${field.name}\\??\\s*):[^\\n]+`), replaceValue);

0 commit comments

Comments
 (0)