Socket
Socket
Sign inDemoInstall

weakmap-polyfill

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    weakmap-polyfill

ECMAScript6 WeakMap polyfill


Version published
Weekly downloads
250K
decreased by-18.69%
Maintainers
1
Install size
10.9 kB
Created
Weekly downloads
 

Readme

Source

weakmap-polyfill

NPM Version Build Status Bundle Size (minified) GitHub License

ECMAScript6 WeakMap polyfill.

Installation

npm

$ npm install --save weakmap-polyfill

Usage

Import or require weakmap-polyfill, then WeakMap will be defined in the global scope if native WeakMap is not supported in running environment.

using import
import 'weakmap-polyfill';
const weakMap = new WeakMap();
using require
require('weakmap-polyfill');
var weakMap = new WeakMap();
browser (standalone)
<script src="weakmap-polyfill.min.js"></script>
<script>
var weakMap = new WeakMap();
</script>

Compatibility

  • Chrome 15
  • Firefox 3
  • IE 7
  • Safari 4
  • Opera 11.5
  • Edge

Browser Tests

Limitations

This polyfill has following few limitations.

  • WeakMap iterable argument is not supported. (23.3.1.1 WeakMap ( [ iterable ] ))
  • Frozen and sealed objects are not supported.
  • The values held by a WeakMap can't be collected once the map itself is GCed, since the values here are tied to the keys. #4

License

MIT

Keywords

FAQs

Last updated on 06 Jun 2021

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc