typia 11.0.1 → 11.0.2
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.
|
@@ -6,7 +6,7 @@ const json_schema_jsDocTags = (schema, jsDocTags) => {
|
|
|
6
6
|
for (const tag of jsDocTags) {
|
|
7
7
|
if (tag.name.startsWith("x-") === false)
|
|
8
8
|
continue;
|
|
9
|
-
const value = (_a = tag.text) === null || _a === void 0 ? void 0 : _a.filter((s) => s.kind === "text").map((s) => s.text.split("\r\n").join("\n"))[0];
|
|
9
|
+
const value = (_a = tag.text) === null || _a === void 0 ? void 0 : _a.filter((s) => s.kind === "text").map((s) => s.text.trim().split("\r\n").join("\n"))[0];
|
|
10
10
|
if (value === undefined)
|
|
11
11
|
continue;
|
|
12
12
|
else
|
|
@@ -23,6 +23,6 @@ const cast = (value) => {
|
|
|
23
23
|
const num = Number(value);
|
|
24
24
|
if (Number.isNaN(num) === false)
|
|
25
25
|
return num;
|
|
26
|
-
return value;
|
|
26
|
+
return value === "null" ? null : value;
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=json_schema_jsDocTags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json_schema_jsDocTags.js","sourceRoot":"","sources":["../../../src/programmers/internal/json_schema_jsDocTags.ts"],"names":[],"mappings":";;;AAIO,MAAM,qBAAqB,GAAG,CACnC,MAAc,EACd,SAA0B,EAClB,EAAE;;IACV,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,KAAK;YAAE,SAAS;QAElD,MAAM,KAAK,GAAuB,MAAA,GAAG,CAAC,IAAI,0CACtC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,EAChC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAA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IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AACzC,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ const json_schema_jsDocTags = (schema, jsDocTags) => {
|
|
|
4
4
|
continue;
|
|
5
5
|
const value = tag.text
|
|
6
6
|
?.filter((s) => s.kind === "text")
|
|
7
|
-
.map((s) => s.text.split("\r\n").join("\n"))[0];
|
|
7
|
+
.map((s) => s.text.trim().split("\r\n").join("\n"))[0];
|
|
8
8
|
if (value === undefined)
|
|
9
9
|
continue;
|
|
10
10
|
else
|
|
@@ -20,7 +20,7 @@ const cast = (value) => {
|
|
|
20
20
|
const num = Number(value);
|
|
21
21
|
if (Number.isNaN(num) === false)
|
|
22
22
|
return num;
|
|
23
|
-
return value;
|
|
23
|
+
return value === "null" ? null : value;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export { json_schema_jsDocTags };
|
package/package.json
CHANGED
|
@@ -11,17 +11,17 @@ export const json_schema_jsDocTags = <Schema extends OpenApi.IJsonSchema>(
|
|
|
11
11
|
|
|
12
12
|
const value: string | undefined = tag.text
|
|
13
13
|
?.filter((s) => s.kind === "text")
|
|
14
|
-
.map((s) => s.text.split("\r\n").join("\n"))[0];
|
|
14
|
+
.map((s) => s.text.trim().split("\r\n").join("\n"))[0];
|
|
15
15
|
if (value === undefined) continue;
|
|
16
16
|
else (schema as any)[tag.name] = cast(value);
|
|
17
17
|
}
|
|
18
18
|
return schema;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
const cast = (value: string): string | number | boolean => {
|
|
21
|
+
const cast = (value: string): string | number | boolean | null => {
|
|
22
22
|
if (value === "true") return true;
|
|
23
23
|
if (value === "false") return false;
|
|
24
24
|
const num: number = Number(value);
|
|
25
25
|
if (Number.isNaN(num) === false) return num;
|
|
26
|
-
return value;
|
|
26
|
+
return value === "null" ? null : value;
|
|
27
27
|
};
|