Minor fixes to schema stuff

main
Mari 3 years ago
parent b1f03c0cf4
commit c6d3032be8
  1. 2
      src/schemata/SchemaData.ts
  2. 2
      src/schemata/YAMLPrompt.ts

@ -8,7 +8,7 @@ interface BaseSchemaData<RepresentedT, ReferenceT extends string> {
schema: unknown, schema: unknown,
key: ReferenceT, key: ReferenceT,
definition: { [key in ReferenceT]: unknown } definition: { [key in ReferenceT]: unknown }
reference: { "ref": ReferenceT }, reference: { "ref": ReferenceT }
validate: ValidateFunction<RepresentedT> validate: ValidateFunction<RepresentedT>
requiredReferences: AnyReferenceList requiredReferences: AnyReferenceList
} }

@ -49,7 +49,7 @@ export async function promptForYaml<ObjectT>({schema, currentValue, name}: YamlP
if (schema.validate(result)) { if (schema.validate(result)) {
return result return result
} else { } else {
await showError(schema.validate.errors?.map((e) => e.toString()).join("; ") || "Failed validation") await showError(schema.validate.errors?.map((e) => e.toString()).join("; ") ?? "Failed validation")
} }
} catch (e) { } catch (e) {
await showError(e.toString()) await showError(e.toString())

Loading…
Cancel
Save