Skip to content

store.put has unintended consequences when your desired key has a period in it #4

@DarthHater

Description

@DarthHater

Hello!

We are looking at using this project for a quick key-value store in a nodejs CLI app. It's really light and clever thus far which we dug, however we've encountered a bit of a fun situation

{
  "pkg:npm/%40cyclonedx/bom@1": {
    "0": {
      "4": {
        "ttl": 1576914172881,
        "response": {
          "coordinates": "pkg:npm/%40cyclonedx/bom@1.0.4",
          "reference": "https://ossindex.sonatype.org/component/pkg:npm/%40cyclonedx/bom@1.0.4",
          "vulnerabilities": []
        }
      }
    }
  }
}

We are trying to save as our key a string that is quite descriptive for our purposes, but has periods in it! This creates a few more nested objects than we would have expected. It works fine, but it feels like an odd situation. I felt like we should file an issue just in case you were curious.

We would have expected to see: pkg:npm/%40cyclonedx/bom@1.0.4 as the initial key.

I realize this is expected behavior of the library as it sits, but looking at it confused me for quite a bit :)

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