- Notifications
You must be signed in to change notification settings - Fork0
A Map that internally encodes Arrays to strings so that two Arrays with the same elements will return the same item.
License
PythonCoderAS/array-string-map
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A Map that internally encodes Arrays to strings so that two Arrays with the same elements will return the same item.
I was using a Map to store array values, and I kept on running into a bug where I could not get those values back. I gotfed up, and then after some Googling, realized that array lookups will not work when two different arrays with the sameelements are used (such as when I use array literal syntax to create them). My solution was to encode the values asstring keys.
ESM modules or TypeScript scripts can just import the normal way, such as:
importArrayStringMapfrom'array-string-map'
However, for CommonJS modules, you need to use therequire function, such as:
const{default:ArrayStringMap}=require("array-string-map")
View the APIhere.
About
A Map that internally encodes Arrays to strings so that two Arrays with the same elements will return the same item.
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.