Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

known

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

known

Allow only access to known object properties using ES2015 Proxy

Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
22
120%
Maintainers
1
Weekly downloads
 
Created
Source

known Build Status

Allow only access to known object properties using ES2015 Proxy

Usage

$ npm install known
const known = require('known');

const object = {foo: true};

console.log(object.bar);
//=> undefined

const object2 = known(object);

// Throws a TypeError when you try to access an unknown property
console.log(object2.bar);
//=> [TypeError] Unknown property: bar
  • on-change - Watch an object or array for changes (Uses Proxy too)
  • negative-array - Negative array index support (Uses Proxy too)

License

MIT © Sindre Sorhus

Keywords

object

FAQs

Package last updated on 21 Apr 2019

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