Skip to content

JSONFileSync won't compile with the latest package release; fix provided #1

@stefanos82

Description

@stefanos82

this.database = new LowSync(new JSONFileSync("Todos.json"));

The line above won't compile anymore as they have modified how it currently works; the new signature is

new LowSync(adapterSync, defaultData)

To make it compile successfully you should have now

const defaultData: schemaType = { tasks: [] }

before

export class JsonTodoCollection extends TodoCollection {

and your old line

this.database = new LowSync(new JSONFileSync("Todos.json"));

should become

this.database = new LowSync(new JSONFileSync("Todos.json"), defaultData);

That should be it, really.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions