isIdCompliant

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.string

This function check if the passed value is “id” compliant. This mean that it has no special characters, no spaces and that it is lowercase

Params

  1. string*-String

    The string to process

Return

  1. -Boolean

    true if compliant, false if not

Example

import { isIdCompliant } from '@blackbyte/sugar/string';
isIdCompliant('Hello world'); // => false
isIdCompliant('hello-world'); // => true