quicktype 16.0.25 → 16.0.27
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/cli/index.js +4 -1
- package/dist/quicktype-core/Transformers.js +3 -1
- package/dist/quicktype-core/input/JSONSchemaInput.js +8 -2
- package/dist/quicktype-core/language/All.js +1 -1
- package/dist/quicktype-core/language/CPlusPlus.js +53 -134
- package/dist/quicktype-core/language/CSharp.js +30 -37
- package/dist/quicktype-core/language/Elm.js +1 -4
- package/dist/quicktype-core/language/Golang.js +7 -7
- package/dist/quicktype-core/language/Haskell.js +15 -15
- package/dist/quicktype-core/language/Java.js +54 -51
- package/dist/quicktype-core/language/JavaScriptPropTypes.js +11 -11
- package/dist/quicktype-core/language/JavaScriptUnicodeMaps.js +1196 -65
- package/dist/quicktype-core/language/Kotlin.js +5 -20
- package/dist/quicktype-core/language/Pike.js +2 -9
- package/dist/quicktype-core/language/Rust.js +11 -11
- package/dist/quicktype-core/language/TypeScriptFlow.js +1 -1
- package/package.json +93 -94
|
@@ -14,7 +14,7 @@ exports.goOptions = {
|
|
|
14
14
|
justTypes: new RendererOptions_1.BooleanOption("just-types", "Plain types only", false),
|
|
15
15
|
justTypesAndPackage: new RendererOptions_1.BooleanOption("just-types-and-package", "Plain types with package only", false),
|
|
16
16
|
packageName: new RendererOptions_1.StringOption("package", "Generated package name", "NAME", "main"),
|
|
17
|
-
multiFileOutput: new RendererOptions_1.BooleanOption("multi-file-output", "Renders each top-level object in its own Go file", false)
|
|
17
|
+
multiFileOutput: new RendererOptions_1.BooleanOption("multi-file-output", "Renders each top-level object in its own Go file", false),
|
|
18
18
|
};
|
|
19
19
|
class GoTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
20
20
|
constructor() {
|
|
@@ -82,7 +82,7 @@ class GoRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
82
82
|
return true;
|
|
83
83
|
}
|
|
84
84
|
makeTopLevelDependencyNames(_, topLevelName) {
|
|
85
|
-
const unmarshalName = new Naming_1.DependencyName(namingFunction, topLevelName.order, lookup => `unmarshal_${lookup(topLevelName)}`);
|
|
85
|
+
const unmarshalName = new Naming_1.DependencyName(namingFunction, topLevelName.order, (lookup) => `unmarshal_${lookup(topLevelName)}`);
|
|
86
86
|
this._topLevelUnmarshalNames.set(topLevelName, unmarshalName);
|
|
87
87
|
return [unmarshalName];
|
|
88
88
|
}
|
|
@@ -135,7 +135,7 @@ class GoRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
135
135
|
return this.goType(t, true);
|
|
136
136
|
}
|
|
137
137
|
goType(t, withIssues = false) {
|
|
138
|
-
return TypeUtils_1.matchType(t, _anyType => Source_1.maybeAnnotated(withIssues, Annotation_1.anyTypeIssueAnnotation, "interface{}"), _nullType => Source_1.maybeAnnotated(withIssues, Annotation_1.nullTypeIssueAnnotation, "interface{}"), _boolType => "bool", _integerType => "int64", _doubleType => "float64", _stringType => "string", arrayType => ["[]", this.goType(arrayType.items, withIssues)], classType => this.nameForNamedType(classType), mapType => {
|
|
138
|
+
return TypeUtils_1.matchType(t, (_anyType) => Source_1.maybeAnnotated(withIssues, Annotation_1.anyTypeIssueAnnotation, "interface{}"), (_nullType) => Source_1.maybeAnnotated(withIssues, Annotation_1.nullTypeIssueAnnotation, "interface{}"), (_boolType) => "bool", (_integerType) => "int64", (_doubleType) => "float64", (_stringType) => "string", (arrayType) => ["[]", this.goType(arrayType.items, withIssues)], (classType) => this.nameForNamedType(classType), (mapType) => {
|
|
139
139
|
let valueSource;
|
|
140
140
|
const v = mapType.values;
|
|
141
141
|
if (v instanceof Type_1.UnionType && TypeUtils_1.nullableFromUnion(v) === null) {
|
|
@@ -145,7 +145,7 @@ class GoRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
145
145
|
valueSource = this.goType(v, withIssues);
|
|
146
146
|
}
|
|
147
147
|
return ["map[string]", valueSource];
|
|
148
|
-
}, enumType => this.nameForNamedType(enumType), unionType => {
|
|
148
|
+
}, (enumType) => this.nameForNamedType(enumType), (unionType) => {
|
|
149
149
|
const nullable = TypeUtils_1.nullableFromUnion(unionType);
|
|
150
150
|
if (nullable !== null)
|
|
151
151
|
return this.nullableGoType(nullable, withIssues);
|
|
@@ -254,7 +254,7 @@ class GoRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
254
254
|
ifMember("class", undefined, (_1, _2, goType) => {
|
|
255
255
|
this.emitLine("var c ", goType);
|
|
256
256
|
});
|
|
257
|
-
const args = makeArgs(fn => ["&x.", fn], (isClass, fn) => {
|
|
257
|
+
const args = makeArgs((fn) => ["&x.", fn], (isClass, fn) => {
|
|
258
258
|
if (isClass) {
|
|
259
259
|
return "true, &c";
|
|
260
260
|
}
|
|
@@ -275,7 +275,7 @@ class GoRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
275
275
|
});
|
|
276
276
|
this.ensureBlankLine();
|
|
277
277
|
this.emitFunc(["(x *", unionName, ") MarshalJSON() ([]byte, error)"], () => {
|
|
278
|
-
const args = makeArgs(fn => ["x.", fn], (_, fn) => ["x.", fn, " != nil, x.", fn]);
|
|
278
|
+
const args = makeArgs((fn) => ["x.", fn], (_, fn) => ["x.", fn, " != nil, x.", fn]);
|
|
279
279
|
this.emitLine("return marshalUnion(", args, ")");
|
|
280
280
|
});
|
|
281
281
|
this.endFile();
|
|
@@ -442,7 +442,7 @@ func marshalUnion(pi *int64, pf *float64, pb *bool, ps *string, haveArray bool,
|
|
|
442
442
|
this.leadingComments === undefined) {
|
|
443
443
|
this.emitSingleFileHeaderComments();
|
|
444
444
|
}
|
|
445
|
-
this.forEachTopLevel("leading-and-interposing", (t, name) => this.emitTopLevel(t, name), t => !(this._options.justTypes || this._options.justTypesAndPackage) ||
|
|
445
|
+
this.forEachTopLevel("leading-and-interposing", (t, name) => this.emitTopLevel(t, name), (t) => !(this._options.justTypes || this._options.justTypesAndPackage) ||
|
|
446
446
|
this.namedTypeToNameForTopLevel(t) === undefined);
|
|
447
447
|
this.forEachObject("leading-and-interposing", (c, className) => this.emitClass(c, className));
|
|
448
448
|
this.forEachEnum("leading-and-interposing", (u, enumName) => this.emitEnum(u, enumName));
|
|
@@ -12,9 +12,9 @@ exports.haskellOptions = {
|
|
|
12
12
|
justTypes: new RendererOptions_1.BooleanOption("just-types", "Plain types only", false),
|
|
13
13
|
useList: new RendererOptions_1.EnumOption("array-type", "Use Array or List", [
|
|
14
14
|
["array", false],
|
|
15
|
-
["list", true]
|
|
15
|
+
["list", true],
|
|
16
16
|
]),
|
|
17
|
-
moduleName: new RendererOptions_1.StringOption("module", "Generated module name", "NAME", "QuickType")
|
|
17
|
+
moduleName: new RendererOptions_1.StringOption("module", "Generated module name", "NAME", "QuickType"),
|
|
18
18
|
};
|
|
19
19
|
class HaskellTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
20
20
|
constructor() {
|
|
@@ -86,15 +86,15 @@ const forbiddenNames = [
|
|
|
86
86
|
"Object",
|
|
87
87
|
"Result",
|
|
88
88
|
"Series",
|
|
89
|
-
"Error"
|
|
89
|
+
"Error",
|
|
90
90
|
];
|
|
91
|
-
const legalizeName = Strings_1.legalizeCharacters(cp => Strings_1.isAscii(cp) && Strings_1.isLetterOrUnderscoreOrDigit(cp));
|
|
91
|
+
const legalizeName = Strings_1.legalizeCharacters((cp) => Strings_1.isAscii(cp) && Strings_1.isLetterOrUnderscoreOrDigit(cp));
|
|
92
92
|
function haskellNameStyle(original, upper) {
|
|
93
93
|
const words = Strings_1.splitIntoWords(original);
|
|
94
94
|
return Strings_1.combineWords(words, legalizeName, upper ? Strings_1.firstUpperWordStyle : Strings_1.allLowerWordStyle, Strings_1.firstUpperWordStyle, upper ? Strings_1.allUpperWordStyle : Strings_1.allLowerWordStyle, Strings_1.allUpperWordStyle, "", Strings_1.isLetterOrUnderscore);
|
|
95
95
|
}
|
|
96
|
-
const upperNamingFunction = Naming_1.funPrefixNamer("upper", n => haskellNameStyle(n, true));
|
|
97
|
-
const lowerNamingFunction = Naming_1.funPrefixNamer("lower", n => haskellNameStyle(n, false));
|
|
96
|
+
const upperNamingFunction = Naming_1.funPrefixNamer("upper", (n) => haskellNameStyle(n, true));
|
|
97
|
+
const lowerNamingFunction = Naming_1.funPrefixNamer("lower", (n) => haskellNameStyle(n, false));
|
|
98
98
|
class HaskellRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
99
99
|
constructor(targetLanguage, renderContext, _options) {
|
|
100
100
|
super(targetLanguage, renderContext);
|
|
@@ -140,12 +140,12 @@ class HaskellRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
haskellType(t, noOptional = false) {
|
|
143
|
-
return TypeUtils_1.matchType(t, _anyType => Source_1.multiWord(" ", "Maybe", "Text"), _nullType => Source_1.multiWord(" ", "Maybe", "Text"), _boolType => Source_1.singleWord("Bool"), _integerType => Source_1.singleWord("Int"), _doubleType => Source_1.singleWord("Float"), _stringType => Source_1.singleWord("Text"), arrayType => {
|
|
143
|
+
return TypeUtils_1.matchType(t, (_anyType) => Source_1.multiWord(" ", "Maybe", "Text"), (_nullType) => Source_1.multiWord(" ", "Maybe", "Text"), (_boolType) => Source_1.singleWord("Bool"), (_integerType) => Source_1.singleWord("Int"), (_doubleType) => Source_1.singleWord("Float"), (_stringType) => Source_1.singleWord("Text"), (arrayType) => {
|
|
144
144
|
if (this._options.useList) {
|
|
145
145
|
return Source_1.multiWord("", "[", Source_1.parenIfNeeded(this.haskellType(arrayType.items)), "]");
|
|
146
146
|
}
|
|
147
147
|
return Source_1.multiWord(" ", "Vector", Source_1.parenIfNeeded(this.haskellType(arrayType.items)));
|
|
148
|
-
}, classType => Source_1.singleWord(this.nameForNamedType(classType)), mapType => Source_1.multiWord(" ", "HashMap Text", Source_1.parenIfNeeded(this.haskellType(mapType.values))), enumType => Source_1.singleWord(this.nameForNamedType(enumType)), unionType => {
|
|
148
|
+
}, (classType) => Source_1.singleWord(this.nameForNamedType(classType)), (mapType) => Source_1.multiWord(" ", "HashMap Text", Source_1.parenIfNeeded(this.haskellType(mapType.values))), (enumType) => Source_1.singleWord(this.nameForNamedType(enumType)), (unionType) => {
|
|
149
149
|
const nullable = TypeUtils_1.nullableFromUnion(unionType);
|
|
150
150
|
if (nullable !== null) {
|
|
151
151
|
const nullableType = this.haskellType(nullable);
|
|
@@ -204,7 +204,7 @@ class HaskellRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
204
204
|
this.emitLine("data ", enumName);
|
|
205
205
|
this.indent(() => {
|
|
206
206
|
let onFirst = true;
|
|
207
|
-
this.forEachEnumCase(e, "none", name => {
|
|
207
|
+
this.forEachEnumCase(e, "none", (name) => {
|
|
208
208
|
const equalsOrPipe = onFirst ? "=" : "|";
|
|
209
209
|
this.emitLine(equalsOrPipe, " ", name, enumName);
|
|
210
210
|
onFirst = false;
|
|
@@ -243,7 +243,7 @@ class HaskellRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
243
243
|
}
|
|
244
244
|
emitClassEncoderInstance(c, className) {
|
|
245
245
|
let classProperties = [];
|
|
246
|
-
this.forEachClassProperty(c, "none", name => {
|
|
246
|
+
this.forEachClassProperty(c, "none", (name) => {
|
|
247
247
|
classProperties.push(" ");
|
|
248
248
|
classProperties.push(name);
|
|
249
249
|
classProperties.push(className);
|
|
@@ -259,7 +259,7 @@ class HaskellRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
259
259
|
this.emitLine("object");
|
|
260
260
|
let onFirst = true;
|
|
261
261
|
this.forEachClassProperty(c, "none", (name, jsonName) => {
|
|
262
|
-
this.emitLine(onFirst ? "[ " : ", ",
|
|
262
|
+
this.emitLine(onFirst ? "[ " : ", ", "\"", Strings_1.stringEscape(jsonName), "\" .= ", name, className);
|
|
263
263
|
onFirst = false;
|
|
264
264
|
});
|
|
265
265
|
if (onFirst) {
|
|
@@ -282,7 +282,7 @@ class HaskellRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
282
282
|
let onFirst = true;
|
|
283
283
|
this.forEachClassProperty(c, "none", (_, jsonName, p) => {
|
|
284
284
|
const operator = p.isOptional ? ".:?" : ".:";
|
|
285
|
-
this.emitLine(onFirst ? "<$> " : "<*> ", "v ", operator,
|
|
285
|
+
this.emitLine(onFirst ? "<$> " : "<*> ", "v ", operator, " \"", Strings_1.stringEscape(jsonName), "\"");
|
|
286
286
|
onFirst = false;
|
|
287
287
|
});
|
|
288
288
|
});
|
|
@@ -298,19 +298,19 @@ class HaskellRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
298
298
|
this.emitLine("instance ToJSON ", enumName, " where");
|
|
299
299
|
this.indent(() => {
|
|
300
300
|
this.forEachEnumCase(e, "none", (name, jsonName) => {
|
|
301
|
-
this.emitLine("toJSON ", name, enumName,
|
|
301
|
+
this.emitLine("toJSON ", name, enumName, " = \"", Strings_1.stringEscape(jsonName), "\"");
|
|
302
302
|
});
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
305
|
emitEnumDecoderInstance(e, enumName) {
|
|
306
306
|
this.emitLine("instance FromJSON ", enumName, " where");
|
|
307
307
|
this.indent(() => {
|
|
308
|
-
this.emitLine(
|
|
308
|
+
this.emitLine("parseJSON = withText \"", enumName, "\" parseText");
|
|
309
309
|
this.indent(() => {
|
|
310
310
|
this.emitLine("where");
|
|
311
311
|
this.indent(() => {
|
|
312
312
|
this.forEachEnumCase(e, "none", (name, jsonName) => {
|
|
313
|
-
this.emitLine(
|
|
313
|
+
this.emitLine("parseText \"", Strings_1.stringEscape(jsonName), "\" = return ", name, enumName);
|
|
314
314
|
});
|
|
315
315
|
});
|
|
316
316
|
});
|
|
@@ -14,7 +14,7 @@ const TypeUtils_1 = require("../TypeUtils");
|
|
|
14
14
|
exports.javaOptions = {
|
|
15
15
|
useList: new RendererOptions_1.EnumOption("array-type", "Use T[] or List<T>", [
|
|
16
16
|
["array", false],
|
|
17
|
-
["list", true]
|
|
17
|
+
["list", true],
|
|
18
18
|
], "array"),
|
|
19
19
|
justTypes: new RendererOptions_1.BooleanOption("just-types", "Plain types only", false),
|
|
20
20
|
dateTimeProvider: new RendererOptions_1.EnumOption("datetime-provider", "Date time provider type", [
|
|
@@ -25,7 +25,7 @@ exports.javaOptions = {
|
|
|
25
25
|
// FIXME: Do this via a configurable named eventually.
|
|
26
26
|
packageName: new RendererOptions_1.StringOption("package", "Generated package name", "NAME", "io.quicktype"),
|
|
27
27
|
lombok: new RendererOptions_1.BooleanOption("lombok", "Use lombok", false, "primary"),
|
|
28
|
-
lombokCopyAnnotations: new RendererOptions_1.BooleanOption("lombok-copy-annotations", "Copy accessor annotations", true, "secondary")
|
|
28
|
+
lombokCopyAnnotations: new RendererOptions_1.BooleanOption("lombok-copy-annotations", "Copy accessor annotations", true, "secondary"),
|
|
29
29
|
};
|
|
30
30
|
class JavaTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
31
31
|
constructor() {
|
|
@@ -39,7 +39,7 @@ class JavaTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
|
39
39
|
exports.javaOptions.acronymStyle,
|
|
40
40
|
exports.javaOptions.packageName,
|
|
41
41
|
exports.javaOptions.lombok,
|
|
42
|
-
exports.javaOptions.lombokCopyAnnotations
|
|
42
|
+
exports.javaOptions.lombokCopyAnnotations,
|
|
43
43
|
];
|
|
44
44
|
}
|
|
45
45
|
get supportsUnionsWithBothNumberTypes() {
|
|
@@ -128,7 +128,7 @@ const javaKeywords = [
|
|
|
128
128
|
"while",
|
|
129
129
|
"null",
|
|
130
130
|
"false",
|
|
131
|
-
"true"
|
|
131
|
+
"true",
|
|
132
132
|
];
|
|
133
133
|
exports.stringEscape = Strings_1.utf16ConcatMap(Strings_1.escapeNonPrintableMapper(Strings_1.isAscii, Strings_1.standardUnicodeHexEscape));
|
|
134
134
|
function isStartCharacter(codePoint) {
|
|
@@ -242,11 +242,17 @@ class Java8DateTimeProvider extends JavaDateTimeProvider {
|
|
|
242
242
|
class JavaLegacyDateTimeProvider extends JavaDateTimeProvider {
|
|
243
243
|
constructor() {
|
|
244
244
|
super(...arguments);
|
|
245
|
-
this.keywords = [
|
|
245
|
+
this.keywords = [
|
|
246
|
+
"SimpleDateFormat",
|
|
247
|
+
"Date",
|
|
248
|
+
];
|
|
246
249
|
this.dateTimeImports = ["java.util.Date"];
|
|
247
250
|
this.dateImports = ["java.util.Date"];
|
|
248
251
|
this.timeImports = ["java.util.Date"];
|
|
249
|
-
this.converterImports = [
|
|
252
|
+
this.converterImports = [
|
|
253
|
+
"java.util.Date",
|
|
254
|
+
"java.text.SimpleDateFormat",
|
|
255
|
+
];
|
|
250
256
|
this.dateTimeType = "Date";
|
|
251
257
|
this.dateType = "Date";
|
|
252
258
|
this.timeType = "Date";
|
|
@@ -260,10 +266,10 @@ class JavaLegacyDateTimeProvider extends JavaDateTimeProvider {
|
|
|
260
266
|
this._renderer.ensureBlankLine();
|
|
261
267
|
this._renderer.emitLine("private static final String[] DATE_TIME_FORMATS = {");
|
|
262
268
|
this._renderer.indent(() => this._renderer.indent(() => {
|
|
263
|
-
this._renderer.emitLine("
|
|
264
|
-
this._renderer.emitLine("
|
|
265
|
-
this._renderer.emitLine("
|
|
266
|
-
this._renderer.emitLine("
|
|
269
|
+
this._renderer.emitLine('"yyyy-MM-dd\'T\'HH:mm:ss.SX",');
|
|
270
|
+
this._renderer.emitLine('"yyyy-MM-dd\'T\'HH:mm:ss.S",');
|
|
271
|
+
this._renderer.emitLine('"yyyy-MM-dd\'T\'HH:mm:ssX",');
|
|
272
|
+
this._renderer.emitLine('"yyyy-MM-dd\'T\'HH:mm:ss",');
|
|
267
273
|
this._renderer.emitLine('"yyyy-MM-dd HH:mm:ss.SX",');
|
|
268
274
|
this._renderer.emitLine('"yyyy-MM-dd HH:mm:ss.S",');
|
|
269
275
|
this._renderer.emitLine('"yyyy-MM-dd HH:mm:ssX",');
|
|
@@ -286,7 +292,7 @@ class JavaLegacyDateTimeProvider extends JavaDateTimeProvider {
|
|
|
286
292
|
});
|
|
287
293
|
this._renderer.ensureBlankLine();
|
|
288
294
|
this._renderer.emitBlock("public static String serializeDateTime(Date datetime)", () => {
|
|
289
|
-
this._renderer.emitLine(
|
|
295
|
+
this._renderer.emitLine('return new SimpleDateFormat("yyyy-MM-dd\'T\'hh:mm:ssZ").format(datetime);');
|
|
290
296
|
});
|
|
291
297
|
this._renderer.ensureBlankLine();
|
|
292
298
|
this._renderer.emitBlock("public static String serializeDate(Date datetime)", () => {
|
|
@@ -335,12 +341,7 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
335
341
|
}
|
|
336
342
|
}
|
|
337
343
|
forbiddenNamesForGlobalNamespace() {
|
|
338
|
-
const keywords = [
|
|
339
|
-
...javaKeywords,
|
|
340
|
-
...this._converterKeywords,
|
|
341
|
-
this._converterClassname,
|
|
342
|
-
...this._dateTimeProvider.keywords
|
|
343
|
-
];
|
|
344
|
+
const keywords = [...javaKeywords, ...this._converterKeywords, this._converterClassname, ...this._dateTimeProvider.keywords];
|
|
344
345
|
return keywords;
|
|
345
346
|
}
|
|
346
347
|
forbiddenForObjectProperties(_c, _className) {
|
|
@@ -368,8 +369,8 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
368
369
|
return TypeUtils_1.directlyReachableSingleNamedType(type);
|
|
369
370
|
}
|
|
370
371
|
makeNamesForPropertyGetterAndSetter(_c, _className, _p, _jsonName, name) {
|
|
371
|
-
const getterName = new Naming_1.DependencyName(this.getNameStyling("propertyNamingFunction"), name.order, lookup => `get_${lookup(name)}`);
|
|
372
|
-
const setterName = new Naming_1.DependencyName(this.getNameStyling("propertyNamingFunction"), name.order, lookup => `set_${lookup(name)}`);
|
|
372
|
+
const getterName = new Naming_1.DependencyName(this.getNameStyling("propertyNamingFunction"), name.order, (lookup) => `get_${lookup(name)}`);
|
|
373
|
+
const setterName = new Naming_1.DependencyName(this.getNameStyling("propertyNamingFunction"), name.order, (lookup) => `set_${lookup(name)}`);
|
|
373
374
|
return [getterName, setterName];
|
|
374
375
|
}
|
|
375
376
|
makePropertyDependencyNames(c, className, p, jsonName, name) {
|
|
@@ -379,9 +380,9 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
379
380
|
}
|
|
380
381
|
getNameStyling(convention) {
|
|
381
382
|
const styling = {
|
|
382
|
-
typeNamingFunction: Naming_1.funPrefixNamer("types", n => javaNameStyle(true, false, n, Acronyms_1.acronymStyle(this._options.acronymStyle))),
|
|
383
|
-
propertyNamingFunction: Naming_1.funPrefixNamer("properties", n => javaNameStyle(false, false, n, Acronyms_1.acronymStyle(this._options.acronymStyle))),
|
|
384
|
-
enumCaseNamingFunction: Naming_1.funPrefixNamer("enum-cases", n => javaNameStyle(true, true, n, Acronyms_1.acronymStyle(this._options.acronymStyle)))
|
|
383
|
+
typeNamingFunction: Naming_1.funPrefixNamer("types", (n) => javaNameStyle(true, false, n, Acronyms_1.acronymStyle(this._options.acronymStyle))),
|
|
384
|
+
propertyNamingFunction: Naming_1.funPrefixNamer("properties", (n) => javaNameStyle(false, false, n, Acronyms_1.acronymStyle(this._options.acronymStyle))),
|
|
385
|
+
enumCaseNamingFunction: Naming_1.funPrefixNamer("enum-cases", (n) => javaNameStyle(true, true, n, Acronyms_1.acronymStyle(this._options.acronymStyle))),
|
|
385
386
|
};
|
|
386
387
|
return styling[convention];
|
|
387
388
|
}
|
|
@@ -456,19 +457,19 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
456
457
|
this.emitTryCatch(f, () => this.emitLine("// Ignored"));
|
|
457
458
|
}
|
|
458
459
|
javaType(reference, t, withIssues = false) {
|
|
459
|
-
return TypeUtils_1.matchType(t, _anyType => Source_1.maybeAnnotated(withIssues, Annotation_1.anyTypeIssueAnnotation, "Object"), _nullType => Source_1.maybeAnnotated(withIssues, Annotation_1.nullTypeIssueAnnotation, "Object"), _boolType => (reference ? "Boolean" : "boolean"), _integerType => (reference ? "Long" : "long"), _doubleType => (reference ? "Double" : "double"), _stringType => "String", arrayType => {
|
|
460
|
+
return TypeUtils_1.matchType(t, (_anyType) => Source_1.maybeAnnotated(withIssues, Annotation_1.anyTypeIssueAnnotation, "Object"), (_nullType) => Source_1.maybeAnnotated(withIssues, Annotation_1.nullTypeIssueAnnotation, "Object"), (_boolType) => (reference ? "Boolean" : "boolean"), (_integerType) => (reference ? "Long" : "long"), (_doubleType) => (reference ? "Double" : "double"), (_stringType) => "String", (arrayType) => {
|
|
460
461
|
if (this._options.useList) {
|
|
461
462
|
return ["List<", this.javaType(true, arrayType.items, withIssues), ">"];
|
|
462
463
|
}
|
|
463
464
|
else {
|
|
464
465
|
return [this.javaType(false, arrayType.items, withIssues), "[]"];
|
|
465
466
|
}
|
|
466
|
-
}, classType => this.nameForNamedType(classType), mapType => ["Map<String, ", this.javaType(true, mapType.values, withIssues), ">"], enumType => this.nameForNamedType(enumType), unionType => {
|
|
467
|
+
}, (classType) => this.nameForNamedType(classType), (mapType) => ["Map<String, ", this.javaType(true, mapType.values, withIssues), ">"], (enumType) => this.nameForNamedType(enumType), (unionType) => {
|
|
467
468
|
const nullable = TypeUtils_1.nullableFromUnion(unionType);
|
|
468
469
|
if (nullable !== null)
|
|
469
470
|
return this.javaType(true, nullable, withIssues);
|
|
470
471
|
return this.nameForNamedType(unionType);
|
|
471
|
-
}, transformedStringType => {
|
|
472
|
+
}, (transformedStringType) => {
|
|
472
473
|
if (transformedStringType.kind === "time") {
|
|
473
474
|
return this._dateTimeProvider.timeType;
|
|
474
475
|
}
|
|
@@ -485,18 +486,18 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
485
486
|
});
|
|
486
487
|
}
|
|
487
488
|
javaImport(t) {
|
|
488
|
-
return TypeUtils_1.matchType(t, _anyType => [], _nullType => [], _boolType => [], _integerType => [], _doubleType => [], _stringType => [], arrayType => {
|
|
489
|
+
return TypeUtils_1.matchType(t, (_anyType) => [], (_nullType) => [], (_boolType) => [], (_integerType) => [], (_doubleType) => [], (_stringType) => [], (arrayType) => {
|
|
489
490
|
if (this._options.useList) {
|
|
490
491
|
return [...this.javaImport(arrayType.items), "java.util.List"];
|
|
491
492
|
}
|
|
492
493
|
else {
|
|
493
494
|
return [...this.javaImport(arrayType.items)];
|
|
494
495
|
}
|
|
495
|
-
}, _classType => [], mapType => [...this.javaImport(mapType.values), "java.util.Map"], _enumType => [], unionType => {
|
|
496
|
+
}, (_classType) => [], (mapType) => [...this.javaImport(mapType.values), "java.util.Map"], (_enumType) => [], (unionType) => {
|
|
496
497
|
const imports = [];
|
|
497
|
-
unionType.members.forEach(type => this.javaImport(type).forEach(imp => imports.push(imp)));
|
|
498
|
+
unionType.members.forEach((type) => this.javaImport(type).forEach((imp) => imports.push(imp)));
|
|
498
499
|
return imports;
|
|
499
|
-
}, transformedStringType => {
|
|
500
|
+
}, (transformedStringType) => {
|
|
500
501
|
if (transformedStringType.kind === "time") {
|
|
501
502
|
return this._dateTimeProvider.timeImports;
|
|
502
503
|
}
|
|
@@ -557,7 +558,7 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
557
558
|
importsForClass(c) {
|
|
558
559
|
const imports = [];
|
|
559
560
|
this.forEachClassProperty(c, "none", (_name, _jsonName, p) => {
|
|
560
|
-
this.javaImport(p.type).forEach(imp => imports.push(imp));
|
|
561
|
+
this.javaImport(p.type).forEach((imp) => imports.push(imp));
|
|
561
562
|
});
|
|
562
563
|
imports.sort();
|
|
563
564
|
return [...new Set(imports)];
|
|
@@ -566,7 +567,7 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
566
567
|
const imports = [];
|
|
567
568
|
const [, nonNulls] = TypeUtils_1.removeNullFromUnion(u);
|
|
568
569
|
this.forEachUnionMember(u, nonNulls, "none", null, (_fieldName, t) => {
|
|
569
|
-
this.javaImport(t).forEach(imp => imports.push(imp));
|
|
570
|
+
this.javaImport(t).forEach((imp) => imports.push(imp));
|
|
570
571
|
});
|
|
571
572
|
imports.sort();
|
|
572
573
|
return [...new Set(imports)];
|
|
@@ -595,9 +596,11 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
595
596
|
this.emitDescription(this.descriptionForClassProperty(c, jsonName));
|
|
596
597
|
const [getterName, setterName] = Support_1.defined(this._gettersAndSettersForPropertyName.get(name));
|
|
597
598
|
const rendered = this.javaType(false, p.type);
|
|
598
|
-
this.annotationsForAccessor(c, className, name, jsonName, p, false)
|
|
599
|
+
this.annotationsForAccessor(c, className, name, jsonName, p, false)
|
|
600
|
+
.forEach(annotation => this.emitLine(annotation));
|
|
599
601
|
this.emitLine("public ", rendered, " ", getterName, "() { return ", name, "; }");
|
|
600
|
-
this.annotationsForAccessor(c, className, name, jsonName, p, true)
|
|
602
|
+
this.annotationsForAccessor(c, className, name, jsonName, p, true)
|
|
603
|
+
.forEach(annotation => this.emitLine(annotation));
|
|
601
604
|
this.emitLine("public void ", setterName, "(", rendered, " value) { this.", name, " = value; }");
|
|
602
605
|
});
|
|
603
606
|
}
|
|
@@ -641,7 +644,7 @@ class JavaRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
641
644
|
this.emitFileHeader(enumName, this.importsForType(e));
|
|
642
645
|
this.emitDescription(this.descriptionForType(e));
|
|
643
646
|
const caseNames = [];
|
|
644
|
-
this.forEachEnumCase(e, "none", name => {
|
|
647
|
+
this.forEachEnumCase(e, "none", (name) => {
|
|
645
648
|
if (caseNames.length > 0)
|
|
646
649
|
caseNames.push(", ");
|
|
647
650
|
caseNames.push(name);
|
|
@@ -689,7 +692,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
689
692
|
"JsonParser",
|
|
690
693
|
"JsonProcessingException",
|
|
691
694
|
"DeserializationContext",
|
|
692
|
-
"SerializerProvider"
|
|
695
|
+
"SerializerProvider",
|
|
693
696
|
];
|
|
694
697
|
}
|
|
695
698
|
emitClassAttributes(c, _className) {
|
|
@@ -699,7 +702,9 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
699
702
|
}
|
|
700
703
|
annotationsForAccessor(_c, _className, _propertyName, jsonName, p, _isSetter) {
|
|
701
704
|
const superAnnotations = super.annotationsForAccessor(_c, _className, _propertyName, jsonName, p, _isSetter);
|
|
702
|
-
const annotations = [
|
|
705
|
+
const annotations = [
|
|
706
|
+
('@JsonProperty("' + exports.stringEscape(jsonName) + '")')
|
|
707
|
+
];
|
|
703
708
|
switch (p.type.kind) {
|
|
704
709
|
case "date-time":
|
|
705
710
|
this._dateTimeProvider.dateTimeJacksonAnnotations.forEach(annotation => annotations.push(annotation));
|
|
@@ -775,7 +780,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
775
780
|
if (this._options.useList && t instanceof Type_1.ArrayType) {
|
|
776
781
|
this.emitLine("value.", fieldName, " = jsonParser.readValueAs(new TypeReference<", rendered, ">() {});");
|
|
777
782
|
}
|
|
778
|
-
else if (stringBasedObjects.some(stringBasedTypeKind => t.kind === stringBasedTypeKind)) {
|
|
783
|
+
else if (stringBasedObjects.some((stringBasedTypeKind) => t.kind === stringBasedTypeKind)) {
|
|
779
784
|
emitDeserializerCodeForStringObjects(fieldName, t.kind, variableFieldName);
|
|
780
785
|
}
|
|
781
786
|
else if (t.kind === "string") {
|
|
@@ -806,7 +811,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
806
811
|
const emitStringDeserializer = () => {
|
|
807
812
|
const enumType = u.findMember("enum");
|
|
808
813
|
const stringType = u.findMember("string");
|
|
809
|
-
if (stringBasedObjects.every(kind => u.findMember(kind) === undefined) &&
|
|
814
|
+
if (stringBasedObjects.every((kind) => u.findMember(kind) === undefined) &&
|
|
810
815
|
stringType === undefined &&
|
|
811
816
|
enumType === undefined)
|
|
812
817
|
return;
|
|
@@ -815,7 +820,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
815
820
|
this.indent(() => {
|
|
816
821
|
const fromVariable = "string";
|
|
817
822
|
this.emitLine("String " + fromVariable + " = jsonParser.readValueAs(String.class);");
|
|
818
|
-
stringBasedObjects.forEach(kind => {
|
|
823
|
+
stringBasedObjects.forEach((kind) => {
|
|
819
824
|
const type = u.findMember(kind);
|
|
820
825
|
if (type !== undefined) {
|
|
821
826
|
this.emitIgnoredTryCatchBlock(() => {
|
|
@@ -874,7 +879,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
874
879
|
const emitSerializeType = (t) => {
|
|
875
880
|
let { fieldName } = this.unionField(u, t, true);
|
|
876
881
|
this.emitBlock(["if (obj.", fieldName, " != null)"], () => {
|
|
877
|
-
if (customObjectSerializer.some(customSerializerType => t.kind === customSerializerType)) {
|
|
882
|
+
if (customObjectSerializer.some((customSerializerType) => t.kind === customSerializerType)) {
|
|
878
883
|
this.emitLine("jsonGenerator.writeObject(", serializerCodeForType(t, ["obj.", fieldName]), ");");
|
|
879
884
|
}
|
|
880
885
|
else {
|
|
@@ -890,7 +895,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
890
895
|
this.emitBlock([
|
|
891
896
|
"public ",
|
|
892
897
|
unionName,
|
|
893
|
-
" deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException"
|
|
898
|
+
" deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException",
|
|
894
899
|
], () => {
|
|
895
900
|
this.emitLine(unionName, " value = new ", unionName, "();");
|
|
896
901
|
this.emitLine("switch (jsonParser.currentToken()) {");
|
|
@@ -913,7 +918,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
913
918
|
this.emitBlock([
|
|
914
919
|
"public void serialize(",
|
|
915
920
|
unionName,
|
|
916
|
-
" obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException"
|
|
921
|
+
" obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException",
|
|
917
922
|
], () => {
|
|
918
923
|
for (const t of nonNulls) {
|
|
919
924
|
emitSerializeType(t);
|
|
@@ -992,16 +997,14 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
992
997
|
"",
|
|
993
998
|
this._options.lombok ? " org.projectlombok : lombok : 1.18.2" : "",
|
|
994
999
|
" com.fasterxml.jackson.core : jackson-databind : 2.9.0",
|
|
995
|
-
this._options.dateTimeProvider === "java8"
|
|
996
|
-
? " com.fasterxml.jackson.datatype : jackson-datatype-jsr310 : 2.9.0"
|
|
997
|
-
: "",
|
|
1000
|
+
this._options.dateTimeProvider === "java8" ? " com.fasterxml.jackson.datatype : jackson-datatype-jsr310 : 2.9.0" : "",
|
|
998
1001
|
"",
|
|
999
1002
|
"Import this package:",
|
|
1000
|
-
""
|
|
1003
|
+
"",
|
|
1001
1004
|
]);
|
|
1002
1005
|
this.emitLine("// import ", this._options.packageName, ".Converter;");
|
|
1003
|
-
this.emitMultiline(`//
|
|
1004
|
-
// Then you can deserialize a JSON string with
|
|
1006
|
+
this.emitMultiline(`//
|
|
1007
|
+
// Then you can deserialize a JSON string with
|
|
1005
1008
|
//`);
|
|
1006
1009
|
this.forEachTopLevel("none", (t, name) => {
|
|
1007
1010
|
this.emitLine("// ", this.javaType(false, t), " data = Converter.", this.decoderName(name), "(jsonString);");
|
|
@@ -1013,7 +1016,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
1013
1016
|
"com.fasterxml.jackson.databind.module.SimpleModule",
|
|
1014
1017
|
"com.fasterxml.jackson.core.JsonParser",
|
|
1015
1018
|
"com.fasterxml.jackson.core.JsonProcessingException",
|
|
1016
|
-
"java.util.*"
|
|
1019
|
+
"java.util.*",
|
|
1017
1020
|
].concat(this._dateTimeProvider.converterImports);
|
|
1018
1021
|
this.emitPackageAndImports(imports);
|
|
1019
1022
|
this.ensureBlankLine();
|
|
@@ -1028,7 +1031,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
1028
1031
|
topLevelTypeRendered,
|
|
1029
1032
|
" ",
|
|
1030
1033
|
this.decoderName(topLevelName),
|
|
1031
|
-
"(String json) throws IOException"
|
|
1034
|
+
"(String json) throws IOException",
|
|
1032
1035
|
], () => {
|
|
1033
1036
|
this.emitLine("return ", this.readerGetterName(topLevelName), "().readValue(json);");
|
|
1034
1037
|
});
|
|
@@ -1038,7 +1041,7 @@ class JacksonRenderer extends JavaRenderer {
|
|
|
1038
1041
|
this.encoderName(topLevelName),
|
|
1039
1042
|
"(",
|
|
1040
1043
|
topLevelTypeRendered,
|
|
1041
|
-
" obj) throws JsonProcessingException"
|
|
1044
|
+
" obj) throws JsonProcessingException",
|
|
1042
1045
|
], () => {
|
|
1043
1046
|
this.emitLine("return ", this.writerGetterName(topLevelName), "().writeValueAsString(obj);");
|
|
1044
1047
|
});
|
|
@@ -18,8 +18,8 @@ exports.javaScriptPropTypesOptions = {
|
|
|
18
18
|
converters: Converters_1.convertersOption(),
|
|
19
19
|
moduleSystem: new RendererOptions_1.EnumOption("module-system", "Which module system to use", [
|
|
20
20
|
["common-js", false],
|
|
21
|
-
["es6", true]
|
|
22
|
-
], "es6")
|
|
21
|
+
["es6", true],
|
|
22
|
+
], "es6"),
|
|
23
23
|
};
|
|
24
24
|
class JavaScriptPropTypesTargetLanguage extends TargetLanguage_1.TargetLanguage {
|
|
25
25
|
getOptions() {
|
|
@@ -33,7 +33,7 @@ class JavaScriptPropTypesTargetLanguage extends TargetLanguage_1.TargetLanguage
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.JavaScriptPropTypesTargetLanguage = JavaScriptPropTypesTargetLanguage;
|
|
36
|
-
const identityNamingFunction = Naming_1.funPrefixNamer("properties", s => s);
|
|
36
|
+
const identityNamingFunction = Naming_1.funPrefixNamer("properties", (s) => s);
|
|
37
37
|
class JavaScriptPropTypesRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
38
38
|
constructor(targetLanguage, renderContext, _jsOptions) {
|
|
39
39
|
super(targetLanguage, renderContext);
|
|
@@ -42,10 +42,10 @@ class JavaScriptPropTypesRenderer extends ConvenienceRenderer_1.ConvenienceRende
|
|
|
42
42
|
nameStyle(original, upper) {
|
|
43
43
|
const acronyms = Acronyms_1.acronymStyle(this._jsOptions.acronymStyle);
|
|
44
44
|
const words = __1.splitIntoWords(original);
|
|
45
|
-
return __1.combineWords(words, JavaScript_1.legalizeName, upper ? __1.firstUpperWordStyle : Strings_1.allLowerWordStyle, __1.firstUpperWordStyle, upper ? s => __1.capitalize(acronyms(s)) : Strings_1.allLowerWordStyle, acronyms, "", JavaScriptUnicodeMaps_1.isES3IdentifierStart);
|
|
45
|
+
return __1.combineWords(words, JavaScript_1.legalizeName, upper ? __1.firstUpperWordStyle : Strings_1.allLowerWordStyle, __1.firstUpperWordStyle, upper ? (s) => __1.capitalize(acronyms(s)) : Strings_1.allLowerWordStyle, acronyms, "", JavaScriptUnicodeMaps_1.isES3IdentifierStart);
|
|
46
46
|
}
|
|
47
47
|
makeNamedTypeNamer() {
|
|
48
|
-
return Naming_1.funPrefixNamer("types", s => this.nameStyle(s, true));
|
|
48
|
+
return Naming_1.funPrefixNamer("types", (s) => this.nameStyle(s, true));
|
|
49
49
|
}
|
|
50
50
|
namerForObjectProperty() {
|
|
51
51
|
return identityNamingFunction;
|
|
@@ -54,7 +54,7 @@ class JavaScriptPropTypesRenderer extends ConvenienceRenderer_1.ConvenienceRende
|
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
makeEnumCaseNamer() {
|
|
57
|
-
return Naming_1.funPrefixNamer("enum-cases", s => this.nameStyle(s, false));
|
|
57
|
+
return Naming_1.funPrefixNamer("enum-cases", (s) => this.nameStyle(s, false));
|
|
58
58
|
}
|
|
59
59
|
namedTypeToNameForTopLevel(type) {
|
|
60
60
|
return TypeUtils_1.directlyReachableSingleNamedType(type);
|
|
@@ -67,10 +67,10 @@ class JavaScriptPropTypesRenderer extends ConvenienceRenderer_1.ConvenienceRende
|
|
|
67
67
|
if (["class", "object", "enum"].indexOf(t.kind) >= 0) {
|
|
68
68
|
return ["_", this.nameForNamedType(t)];
|
|
69
69
|
}
|
|
70
|
-
const match = __1.matchType(t, _anyType => "PropTypes.any", _nullType => "PropTypes.any", _boolType => "PropTypes.bool", _integerType => "PropTypes.number", _doubleType => "PropTypes.number", _stringType => "PropTypes.string", arrayType => ["PropTypes.arrayOf(", this.typeMapTypeFor(arrayType.items, false), ")"], _classType => __1.panic("Should already be handled."), _mapType => "PropTypes.object", _enumType => __1.panic("Should already be handled."), unionType => {
|
|
70
|
+
const match = __1.matchType(t, (_anyType) => "PropTypes.any", (_nullType) => "PropTypes.any", (_boolType) => "PropTypes.bool", (_integerType) => "PropTypes.number", (_doubleType) => "PropTypes.number", (_stringType) => "PropTypes.string", (arrayType) => ["PropTypes.arrayOf(", this.typeMapTypeFor(arrayType.items, false), ")"], (_classType) => __1.panic("Should already be handled."), (_mapType) => "PropTypes.object", (_enumType) => __1.panic("Should already be handled."), (unionType) => {
|
|
71
71
|
const children = Array.from(unionType.getChildren()).map((type) => this.typeMapTypeFor(type, false));
|
|
72
72
|
return ["PropTypes.oneOfType([", ...collection_utils_1.arrayIntercalate(", ", children), "])"];
|
|
73
|
-
}, _transformedStringType => {
|
|
73
|
+
}, (_transformedStringType) => {
|
|
74
74
|
return "PropTypes.string";
|
|
75
75
|
});
|
|
76
76
|
if (required) {
|
|
@@ -102,7 +102,7 @@ class JavaScriptPropTypesRenderer extends ConvenienceRenderer_1.ConvenienceRende
|
|
|
102
102
|
"",
|
|
103
103
|
"MyComponent.propTypes = {",
|
|
104
104
|
" input: MyShape",
|
|
105
|
-
"};"
|
|
105
|
+
"};",
|
|
106
106
|
], "// ");
|
|
107
107
|
}
|
|
108
108
|
emitBlock(source, end, emit) {
|
|
@@ -151,7 +151,7 @@ class JavaScriptPropTypesRenderer extends ConvenienceRenderer_1.ConvenienceRende
|
|
|
151
151
|
let ordinal = 0;
|
|
152
152
|
// pull out all names
|
|
153
153
|
const source = mapValue[index];
|
|
154
|
-
const names = source.filter(value => value);
|
|
154
|
+
const names = source.filter((value) => value);
|
|
155
155
|
// must be behind all these names
|
|
156
156
|
for (let i = 0; i < names.length; i++) {
|
|
157
157
|
const depName = names[i];
|
|
@@ -168,7 +168,7 @@ class JavaScriptPropTypesRenderer extends ConvenienceRenderer_1.ConvenienceRende
|
|
|
168
168
|
order.splice(ordinal, 0, index);
|
|
169
169
|
});
|
|
170
170
|
// now emit ordered source
|
|
171
|
-
order.forEach(i => this.emitGatheredSource(mapValue[i]));
|
|
171
|
+
order.forEach((i) => this.emitGatheredSource(mapValue[i]));
|
|
172
172
|
// now emit top levels
|
|
173
173
|
this.forEachTopLevel("none", (type, name) => {
|
|
174
174
|
if (type instanceof Type_1.PrimitiveType) {
|