1.0.0 • Published 7 years ago

@scriptabuild/readonlyproxy v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

readonlyproxy

Creates a wrapper that looks like the object it wraps, but only provides read only access.

npm install @scriptabuild/readonlyproxy

Example usage:

const wrapInReadOnlyProxy = require("@scriptabuild/readonlyproxy");

let originalObject = { /* lots of properties and nested properties */ };
let wrappedObject = wrapInReadOnlyProxy(originalObject);

// Its not possible to change value on any propery via wrappedObject.
// If you change a property on originalObject, that change is
// immediatly visible through wrappedObject.