fix(tl): made randomId field required

i wanted to make it auto-fill itself but decided it would be too much hassle
This commit is contained in:
teidesu 2021-07-05 20:43:42 +03:00
parent 8b6d587399
commit ed0198f057

View file

@ -170,12 +170,9 @@ const writeSingleSchemaEntry = (type) => {
if (arg.description) ts.comment(arg.description)
ts.write(
`readonly ${arg.name}${
arg.optional ||
(arg.name === 'randomId' && arg.type === 'Long')
? '?'
: ''
}: ${fullTypeName(arg.type)};`
`readonly ${arg.name}${arg.optional}: ${fullTypeName(
arg.type
)};`
)
})
}
@ -228,7 +225,8 @@ const writeSingleSchemaEntry = (type) => {
)} = function (obj) {
switch (obj._) {
${union.subtypes
.map((typ) => `case '${prefix_}${typ}':`).join('')}return true;
.map((typ) => `case '${prefix_}${typ}':`)
.join('')}return true;
}
return false;
};`)