Socket
Socket
Sign inDemoInstall

is-weakmap

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-weakmap

Easily check if a givin object is an ES6 WeakMap


Version published
Maintainers
1
Install size
3.11 kB
Created

Package description

What is is-weakmap?

The is-weakmap npm package is a utility that allows developers to check if a given value is a WeakMap. WeakMaps are collections of key/value pairs where the keys are weakly referenced, meaning they can be garbage collected if there is no other reference to the object. This package provides a straightforward way to determine if an object is an instance of a WeakMap, which can be useful in various programming scenarios where type checking is necessary.

What are is-weakmap's main functionalities?

Checking if a value is a WeakMap

This feature allows developers to check if a given value is an instance of WeakMap. The function returns true if the value is a WeakMap, and false otherwise. This can be particularly useful when working with data structures and ensuring that certain operations or functions are only applied to WeakMaps.

const isWeakMap = require('is-weakmap');

const wm = new WeakMap();
console.log(isWeakMap(wm)); // true

const obj = {};
console.log(isWeakMap(obj)); // false

Other packages similar to is-weakmap

Changelog

Source

v1.0.0 - 2015-02-18

Commits

  • init 837063d

Readme

Source

is-weakmap Build Status

Node module to easily check if an object is an ES6 WeakMap

Installation

$ npm install is-weakmap --save

Usage

var isWeakMap = require('is-weakmap');

isWeakMap(new WeakMap());
//=> true

isWeakMap({});
//=> false

License

MIT © Arthur Verschaeve

Keywords

FAQs

Last updated on 18 Feb 2015

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