1.0.0 • Published 6 years ago
ts-upsert v1.0.0
Map#upsert & WeakMap#upsert polyfill for TypeScript
This package includes the core-js polyfill for Map#upsert and WeakMap#upsert, along with TypeScript typings.
The upsert function is defined in this TC39 proposal.
Installation
npm install --save ts-upsertUsage
import 'ts-upsert'
const map = new Map<string, number>()
map.upsert('foo', () => 1)
map.upsert('bar', undefined, () => 2)
map.upsert('baz', () => 3, undefined)
map.upsert('qux', () => 4, () => 5)API
The API specification is available in the TC39 proposal.
1.0.0
6 years ago