Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deep-freeze-strict

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-freeze-strict

recursively Object.freeze() objects and functions, works in strict mode

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
146K
decreased by-2.5%
Maintainers
1
Weekly downloads
 
Created
Source

deep-freeze

recursively Object.freeze() objects.

this fork works in strict mode, so when freezing a function you don't get the error:

> (function(){ "use strict"; deepFreeze(function(){}); })();

TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them

example

var deepFreeze = require('deep-freeze');

deepFreeze(Buffer);
Buffer.x = 5;
console.log(Buffer.x === undefined);

Buffer.prototype.z = 3;
console.log(Buffer.prototype.z === undefined);

$ node example/deep.js
true
true

methods

var deepFreeze = require('deep-freeze')

deepFreeze(obj)

Call Object.freeze(obj) recursively on all unfrozen properties of obj that are functions or objects.

license

public domain

Based in part on the code snippet from the MDN wiki page on Object.freeze(), which is released to the public domain.

Keywords

FAQs

Package last updated on 04 Dec 2014

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc