isCounterResetCustomIdentValue.js 413 B

123456789101112131415161718192021
  1. 'use strict';
  2. const { counterResetKeywords } = require('../reference/keywords');
  3. /**
  4. * Check value is a custom ident
  5. *
  6. * @param {string} value
  7. */
  8. module.exports = function isCounterResetCustomIdentValue(value) {
  9. const valueLowerCase = value.toLowerCase();
  10. if (
  11. counterResetKeywords.has(valueLowerCase) ||
  12. Number.isFinite(Number.parseInt(valueLowerCase, 10))
  13. ) {
  14. return false;
  15. }
  16. return true;
  17. };