Skip to content

String types are not preserved #277

@olivbau

Description

@olivbau

Environment

nodejs
v1.8.0

Reproduction

const storage = createStorage();
await storage.setItem('123', '456')
const item = await storage.getItem('123');
console.log(item, typeof item)
// 456, number
// instead of: "456", string

Describe the bug

Storage convert string into number for no reason

EDIT:After investigation, it's probably due to destr
https://github.com/unjs/unstorage/blob/main/src/storage.ts#L173C9-L173C21

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions