svelte-reflector 1.3.10 → 1.3.11
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.
|
@@ -66,12 +66,16 @@ export class ArrayProp {
|
|
|
66
66
|
return `${this.name}${required}: ${sanitizedType}[]${nullable}`;
|
|
67
67
|
}
|
|
68
68
|
bundleBuild() {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
if (this._isPrimitiveType || this.isEnum) {
|
|
70
|
+
return `${this.name}: this.${this.name}`;
|
|
71
|
+
}
|
|
72
|
+
if (this.isNullable) {
|
|
73
|
+
return `${this.name}: this.${this.name} == null ? this.${this.name} : this.${this.name}.map((obj) => obj.bundle())`;
|
|
74
|
+
}
|
|
75
|
+
if (!this.isRequired) {
|
|
76
|
+
return `${this.name}: this.${this.name}?.map((obj) => obj.bundle())`;
|
|
77
|
+
}
|
|
78
|
+
return `${this.name}: this.${this.name}.map((obj) => obj.bundle())`;
|
|
75
79
|
}
|
|
76
80
|
queryBundleBuild() {
|
|
77
81
|
return `${this.name}: this.${this.name}?.values`;
|
|
@@ -95,7 +95,9 @@ export class PrimitiveProp {
|
|
|
95
95
|
};
|
|
96
96
|
const buildedExample = this.customType
|
|
97
97
|
? `${this.example}`
|
|
98
|
-
:
|
|
98
|
+
: this.rawType === "boolean" && this.fallbackExample === false && this.example === true
|
|
99
|
+
? `!(params?.empty || isEmpty)`
|
|
100
|
+
: `params?.empty || isEmpty ? ${this.fallbackExample} : ${this.example}`;
|
|
99
101
|
const effectivelyNullable = this.isEffectivelyNullable;
|
|
100
102
|
const keyExpr = effectivelyNullable ? `params?.data?.${name} ?? null` : `params?.data?.${name}`;
|
|
101
103
|
let typeParam = "";
|