@kingjs/reflect.built-in-symbols
v1.0.0
Published
A mapping from symbol to name for each `Symbol` property whose value is a symbol.
Downloads
16
Readme
@kingjs/reflect.built-in-symbols
A mapping from symbol to name for each Symbol
property whose value is a symbol.
Usage
var assert = require('assert')
var builtInSymbols = require('@kingjs/reflect.built-in-symbols');
// all builtInSymbols are in Symbol
for (var symbol of Object.getOwnPropertySymbols(builtInSymbols)) {
var name = builtInSymbols[symbol];
assert(Symbol[name] === symbol);
}
// all Symbols are in builtInSymbols
for (var name of Object.getOwnPropertyNames(Symbol)) {
var symbol = Symbol[name];
if (typeof symbol != 'symbol')
continue;
assert(builtInSymbols[symbol] == name);
}
Install
With npm installed, run
$ npm install @kingjs/reflect.built-in-symbols
Source
https://repository.kingjs.net/reflect/built-in-symbols
License
MIT