is-valid-variable

Check if a token is a valid variable name

MIT 2 个版本
安装
npm install is-valid-variable
yarn add is-valid-variable
pnpm add is-valid-variable
bun add is-valid-variable
README

is-valid-variable

Check if a token is a valid variable name

npm install is-valid-property

Doesn't try to follow the full spec, ie might say false when something should be true, but will never say true when something should be false

Usage

const isValidVariable = require('is-valid-variable')

console.log(isValidVariable('const')) // false
console.log(isValidVariable('constantin')) // true
console.log(isValidVariable('64')) // false
console.log(isValidVariable('x64')) // true

License

MIT

版本列表
1.0.1 2023-05-31
1.0.0 2023-05-31