yn-js
yn-js
replaces boolean values (e.g.: yes/no, true/false, 1/0, etc.) with user-specified strings (e.g.: 'Yes/No', 'On/Off', 'A/B').
Install
$ npm install yn-js
Usage
const yn = ;let str = 'Yes' 'No'; // Returns 'True'let a = ;console; // Returns 'No'let b = ;console; // Returns 'B'let c = ;console; // Returns 'Bad'let d = ;console; // Returns 'Good'let e = ;console;
Options
yn-js
accepts the following parameters.
input (Boolean = '')
The string value you wish to obfuscate or mask from the viewer.
separator (Array = ['True', 'False'])
An array of values you wish to display for "truthy" and "falsy" statements in that order. Truthy statements include one of: true
, 1
, '1'
, 'yes'
, 'on'
, 'true'
license
ISC