https://github.com/vilicvane/mixed-map
A simple map implementation that prefers `WeakMap` but uses `Map` as backup for primitive keys.
https://github.com/vilicvane/mixed-map
Last synced: 3 months ago
JSON representation
A simple map implementation that prefers `WeakMap` but uses `Map` as backup for primitive keys.
- Host: GitHub
- URL: https://github.com/vilicvane/mixed-map
- Owner: vilicvane
- Created: 2017-09-16T10:08:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T07:33:59.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T00:54:54.128Z (3 months ago)
- Language: TypeScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/mixed-map)
# Mixed Map
A simple map implementation that prefers `WeakMap` but uses `Map` as backup for primitive keys.
## Installation
```sh
yarn add mixed-map
# or
npm install mixed-map --save
```## API
```ts
export declare class MixedMap {
has(key: K): boolean;
get(key: K): V | undefined;
set(key: K, value: V): this;
delete(key: K): boolean;
}export default MixedMap;
```## License
MIT License.