incomplete-symbol
v1.0.0
Published
Custom-remove features of a Symbol implementation.
Downloads
16
Readme
incomplete-symbol
Custom-remove features of a
Symbol
implementation.
This is useful when simulating the incomplete Symbol
implementations available in some of today's modern web browsers.
Installation
Node.js >= 8
is required. To install, type this at the command line:
npm install incomplete-symbol
Usage
const customizeSymbol = require('incomplete-symbol');
const exclusions = ['description', 'toStringTag'];
const IncompleteSymbol = customizeSymbol(exclusions);
const symbol = new IncompleteSymbol('foo');
console.log(IncompleteSymbol.toStringTag); //-> undefined
console.log(symbol.description); //-> undefined
Arguments
exclusions
Type: Array
Default value: []
The output Symbol
function and any instances created with it will not expose each listed property/method.