@agoric/make-hardener

Create a 'hardener' which freezes the API surface of a set of objects

The `ses` package provides `harden` after `lockdown`. Do not use `@agoric/make-hardener` directly.
Last updated 5 years ago by michaelfig .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @agoric/make-hardener 
SYNC missed versions from official npm registry.

MakeHardener

Build Status dependency status dev dependency status License

Build a defensible API surface around an object by freezing all reachable properties.

How to use

Note: If you're writing an application, you probably don't want to use this package directly. You'll want to use the harden() function provided in SES to perform an all-encompassing "deep freeze" on your objects. Alternatively, if you want to test your code before using it in SES, you can import the @agoric/harden package. Note that without SES, harden() is insecure, and should be used for testing purposes only.

Why do we need to "harden" objects?

Please see the harden() package for more documentation.

Creating a custom harden() Function

This package (@agoric/make-hardener) provides a makeHardener() which can be used to build your own harden() function. When you call makeHardener(), you give it an iterable of stopping points (the "fringe"), and the recursive property walk will stop its search when it runs into the fringe. The resulting harden() will throw an exception if anything it freezes has a prototype that is not already in the fringe, or was frozen during the same call (and thus added to the fringe).

Current Tags

  • 0.1.3                                ...           latest (5 years ago)

13 Versions

  • 0.1.3 [deprecated]           ...           5 years ago
  • 0.1.2 [deprecated]           ...           5 years ago
  • 0.1.1 [deprecated]           ...           6 years ago
  • 0.1.0 [deprecated]           ...           6 years ago
  • 0.0.9 [deprecated]           ...           6 years ago
  • 0.0.8 [deprecated]           ...           6 years ago
  • 0.0.7 [deprecated]           ...           6 years ago
  • 0.0.6 [deprecated]           ...           7 years ago
  • 0.0.5 [deprecated]           ...           7 years ago
  • 0.0.4 [deprecated]           ...           7 years ago
  • 0.0.3 [deprecated]           ...           7 years ago
  • 0.0.2 [deprecated]           ...           7 years ago
  • 0.0.1 [deprecated]           ...           7 years ago
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 4
Last Month 0
Dependencies (0)
None
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |