New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ts-upsert

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-upsert

This package includes the [core-js](https://github.com/zloirock/core-js) polyfill for `Map#upsert` and `WeakMap#upsert`, along with TypeScript typings.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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-upsert

Usage

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.

Keywords

Map

FAQs

Package last updated on 18 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts