All files / src/node-transformers/obfuscation-transformers/replacers BooleanLiteralReplacer.ts

100% Statements 10/10
100% Branches 2/2
100% Functions 1/1
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291x 1x       1x   1x     1x             1734x               9561x      
import { injectable, inject } from 'inversify';
import { ServiceIdentifiers } from '../../../container/ServiceIdentifiers';
 
import { IOptions } from '../../../interfaces/options/IOptions';
 
import { JSFuck } from '../../../enums/JSFuck';
 
import { AbstractReplacer } from './AbstractReplacer';
 
@injectable()
export class BooleanLiteralReplacer extends AbstractReplacer {
    /**
     * @param options
     */
    constructor (
        @inject(ServiceIdentifiers.IOptions) options: IOptions
    ) {
        super(options);
    }
 
    /**
     * @param nodeValue
     * @returns {string}
     */
    public replace (nodeValue: boolean): string {
        return nodeValue ? JSFuck.True : JSFuck.False;
    }
}