1.0.0 • Published 3 years ago

nv-validator-cssident v1.0.0

Weekly downloads
3
License
ISC
Repository
-
Last release
3 years ago

nv-validator-cssident

  • nv-validator-cssident

install

  • npm install nv-validator-cssident

usage

This identifier 
    is composed by 
        case-insensitive letter a to z, 
        numbers 0 to 9, 
        an underscore (_) or a dash(-). 
    The first non-dash character 
        must be a letter (that is no number at the beginning of it, even preceded by a dash). 
    Also two dashes are forbidden at the beginning of the identifier.

example

const vali_cssident = require("nv-validator-cssident");

> vali_cssident.IDENT("-0-transform")
Error: first non-dash character must be a letter
>
> vali_cssident.IDENT("-_-transform")
Error: first non-dash character must be a letter

>
> vali_cssident.IDENT("--transform")
Error: two dashes are forbidden at the beginning of the identifier

>
> vali_cssident.IDENT("-transform@__")
Error: case-insensitive letter a to z,numbers 0 to 9,underscore (_), dash(-)

>
> vali_cssident.IDENT("-transform__")
'-transform__'
>

> vali_cssident.IDENT.val()
'-transform__'
>

API

  • vali_cssident.IDENT(ident_str)
  • vali_cssident.ERROR_DICT

LICENSE

  • ISC