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.
@@ -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, " { ", (0, collection_utils_1.arrayIntercalate)(", ", caseNames), " }");
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype-core",
3
- "version": "23.0.62",
3
+ "version": "23.0.63",
4
4
  "description": "The quicktype engine as a library",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",