22 lines
425 B
JavaScript
22 lines
425 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const { counterIncrementKeywords } = require('../reference/keywords');
|
||
|
|
||
|
/**
|
||
|
* Check value is a custom ident
|
||
|
*
|
||
|
* @param {string} value
|
||
|
*/
|
||
|
module.exports = function isCounterIncrementCustomIdentValue(value) {
|
||
|
const valueLowerCase = value.toLowerCase();
|
||
|
|
||
|
if (
|
||
|
counterIncrementKeywords.has(valueLowerCase) ||
|
||
|
Number.isFinite(Number.parseInt(valueLowerCase, 10))
|
||
|
) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
return true;
|
||
|
};
|