prismadoc 1.0.37 → 1.0.38
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/entities/field.js +6 -1
- package/package.json +1 -1
package/dist/entities/field.js
CHANGED
|
@@ -170,11 +170,16 @@ export class DocGenField {
|
|
|
170
170
|
if (this.isArray) {
|
|
171
171
|
return `${this.type}[]`;
|
|
172
172
|
}
|
|
173
|
+
else if (!this.isRequired && this.fieldType === "res") {
|
|
174
|
+
return `${this.type} | null`;
|
|
175
|
+
}
|
|
173
176
|
else {
|
|
174
177
|
return this.type;
|
|
175
178
|
}
|
|
176
179
|
};
|
|
177
|
-
|
|
180
|
+
let optionalFlag = "?";
|
|
181
|
+
if (this.isRequired || this.fieldType === "res")
|
|
182
|
+
optionalFlag = "!";
|
|
178
183
|
const validators = this.sanitizeValidators();
|
|
179
184
|
const apiExample = this.buildApiExample().join(", ");
|
|
180
185
|
return {
|