Skip to content

Correct the return type for getItem in MemoryStorage#1350

Open
nickedelenbos wants to merge 1 commit into
manfredsteyer:masterfrom
nickedelenbos:patch-2
Open

Correct the return type for getItem in MemoryStorage#1350
nickedelenbos wants to merge 1 commit into
manfredsteyer:masterfrom
nickedelenbos:patch-2

Conversation

@nickedelenbos

Copy link
Copy Markdown

The Memory storage uses a Map as backing storage. However, the Map return type for get is not purely string, it could also be undefined, hence this PR. (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get)

Another suggestion is that using MemoryStorage will save the nonce, if used, in memory as well, making it easy to make a whoopsie (see my other PR). Perhaps this MemoryStorage should at least warn about not saving a nonce there?

@nickedelenbos

Copy link
Copy Markdown
Author

Any updates on this? Please refer to the spec when in doubt: https://tc39.es/ecma262/multipage/keyed-collections.html#sec-map.prototype.get

@L-X-T L-X-T force-pushed the master branch 4 times, most recently from a54ea92 to 078415b Compare December 2, 2024 12:32
@L-X-T L-X-T force-pushed the master branch 2 times, most recently from e1fc6c5 to 5d10af2 Compare June 30, 2025 12:18
@L-X-T L-X-T force-pushed the master branch 2 times, most recently from 1421146 to 4dff3c3 Compare June 11, 2026 07:23
@L-X-T L-X-T force-pushed the master branch 5 times, most recently from 581dc7a to 328e014 Compare June 26, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant