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,
key: ReferenceT,
definition: { [key in ReferenceT]: unknown }
reference: { "ref": ReferenceT },
reference: { "ref": ReferenceT }
validate: ValidateFunction<RepresentedT>
requiredReferences: AnyReferenceList
}

@ -49,7 +49,7 @@ export async function promptForYaml<ObjectT>({schema, currentValue, name}: YamlP
if (schema.validate(result)) {
return result
} 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) {
await showError(e.toString())

Loading…
Cancel
Save