Skip to content

defaults not working #92

@leasontou

Description

@leasontou

First, I set a defaults value when init the Storage object like this:

const defaults = {
  config: {
    node: {
      list: [
        'node1',
        'node2',
        'node3'
      ],
      current: 'node1'
    },
    language: 'en'
  }
}

const storage = new Storage({
  defaults
});

this default values will be generated after my app launches for the first time.
but then, I modify config.json manually, delete the value for key config.node, save file.
after that, content in config.json is:

{
  "config": {
    "language": "en"
  }
}

then I launch my app, storage.get("config.node") return undefined, I think it will regenerate the default value after I delete them, but it doesn't.

Is this a bug?

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