quicktype-core 23.0.62 → 23.0.63
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/Dart.js +11 -3
- package/package.json +1 -1
package/dist/language/Dart.js
CHANGED
|
@@ -11,7 +11,6 @@ const TargetLanguage_1 = require("../TargetLanguage");
|
|
|
11
11
|
const RendererOptions_1 = require("../RendererOptions");
|
|
12
12
|
const Annotation_1 = require("../Annotation");
|
|
13
13
|
const Support_1 = require("../support/Support");
|
|
14
|
-
const collection_utils_1 = require("collection-utils");
|
|
15
14
|
exports.dartOptions = {
|
|
16
15
|
nullSafety: new RendererOptions_1.BooleanOption("null-safety", "Null Safety", true),
|
|
17
16
|
justTypes: new RendererOptions_1.BooleanOption("just-types", "Types only", false),
|
|
@@ -551,9 +550,18 @@ class DartRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
551
550
|
});
|
|
552
551
|
}
|
|
553
552
|
emitEnumDefinition(e, enumName) {
|
|
554
|
-
const caseNames = Array.from(e.cases).map(c => this.nameForEnumCase(e, c));
|
|
555
553
|
this.emitDescription(this.descriptionForType(e));
|
|
556
|
-
this.emitLine("enum ", enumName, " {
|
|
554
|
+
this.emitLine("enum ", enumName, " {");
|
|
555
|
+
this.indent(() => {
|
|
556
|
+
this.forEachEnumCase(e, "none", (name, jsonName, pos) => {
|
|
557
|
+
const comma = pos === "first" || pos === "middle" ? "," : [];
|
|
558
|
+
if (this._options.useJsonAnnotation) {
|
|
559
|
+
this.emitLine('@JsonValue("', stringEscape(jsonName), '")');
|
|
560
|
+
}
|
|
561
|
+
this.emitLine(name, comma);
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
this.emitLine("}");
|
|
557
565
|
if (this._options.justTypes)
|
|
558
566
|
return;
|
|
559
567
|
this.ensureBlankLine();
|