🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@ungap/weakmap

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ungap/weakmap

An essential WeakMap polyfill for legacy browsers.

0.2.1
latest
Source
npm
Version published
Weekly downloads
9.7K
63.28%
Maintainers
1
Weekly downloads
 
Created
Source

WeakMap

Build Status Coverage Status Greenkeeper badge WebReflection status

An essential WeakMap polyfill for legacy browsers (IE < 11).

  • CDN via https://unpkg.com/@ungap/weakmap
  • ESM via import WeakMap from '@ungap/weakmap'
  • CJS via const WeakMap = require('@ungap/weakmap')

Compatible down to IE9, works well with ES5 shim upfront in IE8 (and maybe lower too).

Live test

Transpiled code and frozen objects in legacy browsers

If you need this module to work in IE < 11 too with frozen objects, or template literals frozen via Babel transpilation, you need to either nullify Object.freeze and others via something like <script>this.WeakMap||(Object.freeze=Object);</script> on top of your pages, or you can nullify only template literals through:

<script>
this.WeakMap||(function(O,f){
  f=O.freeze||O;O.freeze=function(o){return'raw'in o?o:f(o)}
}(Object));
</script>

Keywords

WeakMap

FAQs

Package last updated on 21 Jun 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