New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

es2015-proxy-shim

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es2015-proxy-shim

A limited ES2015 Proxy shim.

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

es2015-proxy-shim Build Status npm semantic-release Commitizen friendly

An ES2015 Proxy shim that relies on a non-extensible fixed set of properties at the time of proxying a target object or function.

This shim is limited to a few supported traps:

  • construct, apply (on functions)
  • get, set

This shim relies on a decent ES2015 support, e.g.

  • for-of loops
  • symbols
  • WeakMap
  • Reflect

Use shims like core-js, if needed.

This shim patches Reflect.set which needs to walk in sync w.r.t. proxy objects.

Install

$ npm install es2015-proxy-shim --save

Usage

require("core-js/shim");
require("es2015-proxy-shim");

var p = new Proxy({ foo: 5 }, {
    get: function(t, k, r) {
        console.log("#get", t, k);
        return Reflect.get(t, k, r);
    }
});
p.foo = 8;
console.log("is", p.foo);

License

MIT © Daniel Bölzle

Keywords

es2015

FAQs

Package last updated on 16 Nov 2016

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