Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 20 days 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T07:33:59.000Z (over 1 year ago)
- Last Synced: 2024-11-30T15:41:57.236Z (23 days ago)
- Language: TypeScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![NPM Package](https://badge.fury.io/js/mixed-map.svg)](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.