UNPKG

@senzil/cec-monitor

Version:

HDMI-CEC library with a simple monitor written on ES6 to make cec enabled apps.

33 lines (27 loc) 776 B
/** * Created by pablo on 9/22/17. */ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; class Validate { /** * Determine if provided string matches a CEC physical address * @param {String} address Address to test * @return {Boolean} True if it matches form 0.0.0.0 otherwise false */ static isRoute(address) { return /^[0-9]\.[0-9]\.[0-9]\.[0-9]$/gui.test(address); } /** * Determine if provided string matches a hexadecimal number representation * @param {String} address Address to test * @return {Boolean} True if it matches form 0.0.0.0 otherwise false */ static isHexaNumber(address) { return /^0[Xx][0-9A-Fa-f]+$/giu.test(address); } } exports.default = Validate;