Skip to content
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
dist
src
.eslintrc
.gitignore
README.md
package.json
yarn.lock

README.md

Syamu Proxy

npm CircleCI donate

Install

yarn add syamu-proxy

Usage

const syamuProxy = require('syamu-proxy');

const proxied = syamuProxy({
  num: 28,
  get num2() {
    return this.num;
  },
  str: 'a',
  get str2() {
    return this.str;
  },
  arr: ['foo', 'bar'],
  obj: {
    foo: 'foo',
    bar: 'bar'
  },
  void: undefined
});

console.log(proxied.num); // 0
console.log(proxied.num2); // 0
console.log(proxied.str); // ''
console.log(proxied.str2); // ''
console.log(proxied.arr); // []
console.log(proxied.obj); // {}
console.log(proxied.null) // null
console.log(proxied.undefined) // undefined
You can’t perform that action at this time.