Files
enm-cli/util/validation.js
Vyacheslav.Sviridov 1fb7a6f81b first commit
2022-05-13 18:13:36 +06:00

10 lines
429 B
JavaScript

const chalk = require('chalk')
const isEmpty = input => (input === '' ? chalk.bgRed('Empty Inputs not Allowed') : true)
const isValidHardwareId = input => (input.match(/[A-HJ-NP-Z0-9]{13}/) ? true : chalk.bgRed(`The Ericsson Hardware Serial Number frame consists of 13 alphanumeric characters.
Character set is the letters A-Z with the exception of O and I, and digits 0-9.`))
module.exports = { isEmpty, isValidHardwareId }