Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store strings like '83528e0696' result in Infinity #590

Open
intellild opened this issue Feb 6, 2025 · 1 comment · May be fixed by #591
Open

store strings like '83528e0696' result in Infinity #590

intellild opened this issue Feb 6, 2025 · 1 comment · May be fixed by #591
Labels
bug Something isn't working

Comments

@intellild
Copy link

Environment

unstorage 1.14.4

Reproduction

https://codesandbox.io/p/sandbox/bold-waterfall-qgqgpg

import { createStorage } from "unstorage";

const storage = createStorage();

storage
  .setItem("foo", "83528e0696")
  .then(() => {
    return storage.getItem("foo");
  })
  .then((result) => {
    console.log(result);
  });

Describe the bug

The console logs Infinity.
Expected to be '83528e0696'

Additional context

No response

Logs

@intellild intellild added the bug Something isn't working label Feb 6, 2025
@intellild
Copy link
Author

intellild commented Feb 6, 2025

I tried to fix it but these behavior are so weird

await ctx.storage.setItem("nullStringItem", "null");

Such behavior should never exist. It is totally a bug if someone changed username to 'null', 'undefined', 'NaN'.

@intellild intellild linked a pull request Feb 6, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant