hasValidHex.cjs 455 B

1234567891011121314151617
  1. // NOTICE: This file is generated by Rollup. To modify it,
  2. // please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
  3. 'use strict';
  4. const HAS_VALID_HEX = /#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})(?:$|[^\da-f])/i;
  5. /**
  6. * Check if a value contains a valid 3, 4, 6 or 8 digit hex
  7. *
  8. * @param {string} value
  9. * @returns {boolean}
  10. */
  11. function hasValidHex(value) {
  12. return HAS_VALID_HEX.test(value);
  13. }
  14. module.exports = hasValidHex;