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