New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

frozen-set

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frozen-set

Like Set, but without methods for mutation

1.0.1
Source
npm
Version published
Weekly downloads
58
56.76%
Maintainers
1
Weekly downloads
 
Created
Source

frozen-set

This npm module provides frozen (fixed) sets: sets which will not change after construction. These behave like ES2015 Sets in all other ways, but do not expose add, clear, or delete (or any other set-modifying methods which might be added to the language in the future).

There are two versions: FrozenSet and MostlyFrozenSet. These have the same API, but FrozenSet will deter even an actively malicious adversary from modifying the underlying set, whereas MostlyFrozenSet will only discourage people who are not really dedicated. MostlyFrozenSet is probably faster.

Note that these are only "shallowly" frozen - that is, if the set contains a mutable object, that object will remain mutable (just as with Object.freeze).

Keywords

frozen

FAQs

Package last updated on 30 Dec 2018

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