You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 573B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.isHex = exports.isFlagEnabled = exports.onlyHasFields = void 0;
  4. const HEX_REGEX = /^[0-9A-Fa-f]+$/u;
  5. function onlyHasFields(obj, fields) {
  6. return Object.keys(obj).every((key) => fields.includes(key));
  7. }
  8. exports.onlyHasFields = onlyHasFields;
  9. function isFlagEnabled(Flags, checkFlag) {
  10. return (checkFlag & Flags) === checkFlag;
  11. }
  12. exports.isFlagEnabled = isFlagEnabled;
  13. function isHex(str) {
  14. return HEX_REGEX.test(str);
  15. }
  16. exports.isHex = isHex;
  17. //# sourceMappingURL=index.js.map