Fallback when a value is not Symbol.
Via NPM:
npm install symvl
Via Yarn:
yarn add symvl
const symvl = require('symvl');
// When a value is not Symbol, it will return fallback value.
let a = symvl(null, 0); // a = 0
let b = symvl({}, 'x'); // b = 'x'
// When a value is Symbol, it will return that value.
let c = symvl(Symbol(), 1); // c = Symbol()
let d = symvl(Symbol('SYMBOL'), 'abc'); // d = Symbol(SYMBOL)
A main value.
A fallback value.