| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1x 1x 1x 52125x 52125x 1006x 51119x | import { AbstractReplacer } from './AbstractReplacer';
import { Utils } from '../../Utils';
export class NumberLiteralReplacer extends AbstractReplacer {
/**
* @param nodeValue
* @returns {string}
*/
public replace (nodeValue: number): string {
const prefix: string = '0x';
if (!Utils.isInteger(nodeValue)) {
return String(nodeValue);
}
return `${prefix}${Utils.decToHex(nodeValue)}`;
}
}
|