Skip to content

A simple map implementation that prefers `WeakMap` but uses `Map` as backup for primitive keys.

Notifications You must be signed in to change notification settings

vilicvane/mixed-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM Package

Mixed Map

A simple map implementation that prefers WeakMap but uses Map as backup for primitive keys.

Installation

yarn add mixed-map
# or
npm install mixed-map --save

API

export declare class MixedMap<K, V> {
  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.

About

A simple map implementation that prefers `WeakMap` but uses `Map` as backup for primitive keys.

Resources

Stars

Watchers

Forks

Packages

No packages published