Skip to content

Commit

Permalink
refactor(CreateConfig): use correct type for validateConfigContent
Browse files Browse the repository at this point in the history
The result of yaml.load is of type "unknown", not "object", so we can't
assume the input to validateConfigContent is even an object.

Noticed while fixing all errors caused by executing vue-tsc

Signed-off-by: Lukas Mertens <[email protected]>
  • Loading branch information
lukas-mertens committed Oct 12, 2024
1 parent 01cb49b commit ecbba68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/CreateConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function uploadConfigPrompt() {
/**
* Validates that the config content is a valid JSON or YAML config
*/
async function validateConfigContent(content: object): Promise<true | string> {
async function validateConfigContent(content: unknown): Promise<true | string> {
const ajv = new Ajv();
const schema = await getConfigJsonSchema();
const validate = ajv.compile(schema);
Expand Down

0 comments on commit ecbba68

Please sign in to comment.