Skip to content

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

License

Notifications You must be signed in to change notification settings

scriptabuild/readonlyproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published