Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/schema/src/plugins/enhancer/enhance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ export type Enhanced<Client> =
throw new PluginError(name, `Unexpected syntax list structure in ${fileName}`);
}

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

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

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