isCounterResetCustomIdentValue.js 385 B

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