is-upc
Returns true or false, whether the value is a valid UPC-A or UPC-E (GTIN-12) code.
// You can do strict comparisons on the returned falsy values// to determine why it is not a valid code.// undefined - Code is not a number or a string.// null - Code does not fit the 12-digit format.// false - Check digit validation failed. // undefined // null // false // true // true // Be careful when using numbers as the input: // null // true