quicktype-core 23.0.79 → 23.0.81
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/language/Golang.js
CHANGED
|
@@ -16,7 +16,8 @@ exports.goOptions = {
|
|
|
16
16
|
justTypesAndPackage: new RendererOptions_1.BooleanOption("just-types-and-package", "Plain types with package only", false),
|
|
17
17
|
packageName: new RendererOptions_1.StringOption("package", "Generated package name", "NAME", "main"),
|
|
18
18
|
multiFileOutput: new RendererOptions_1.BooleanOption("multi-file-output", "Renders each top-level object in its own Go file", false),
|
|
19
|
-
fieldTags: new RendererOptions_1.StringOption("field-tags", "list of tags which should be generated for fields", "TAGS", "json")
|
|
19
|
+
fieldTags: new RendererOptions_1.StringOption("field-tags", "list of tags which should be generated for fields", "TAGS", "json"),
|
|
20
|
+
omitEmpty: new RendererOptions_1.BooleanOption("omit-empty", "If set, all non-required objects will be tagged with ,omitempty", false)
|
|
20
21
|
};
|
|
21
22
|
class GoTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
22
23
|
constructor() {
|
|
@@ -60,6 +61,8 @@ function isValueType(t) {
|
|
|
60
61
|
function canOmitEmpty(cp) {
|
|
61
62
|
if (!cp.isOptional)
|
|
62
63
|
return false;
|
|
64
|
+
if (exports.goOptions.omitEmpty)
|
|
65
|
+
return true;
|
|
63
66
|
const t = cp.type;
|
|
64
67
|
return ["union", "null", "any"].indexOf(t.kind) < 0;
|
|
65
68
|
}
|
package/dist/language/Rust.js
CHANGED
|
@@ -169,7 +169,9 @@ const keywords = [
|
|
|
169
169
|
"default",
|
|
170
170
|
"dyn",
|
|
171
171
|
"'static",
|
|
172
|
-
"union"
|
|
172
|
+
"union",
|
|
173
|
+
// Conflict between `std::Option` and potentially generated Option
|
|
174
|
+
"option"
|
|
173
175
|
];
|
|
174
176
|
const isAsciiLetterOrUnderscoreOrDigit = (codePoint) => {
|
|
175
177
|
if (!(0, Strings_1.isAscii)(codePoint)) {
|