shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
idCompliant
Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.string
This function take a string and return a version of it that you can safely use in html id for example. It replace spaces with ’-’ as well as all the special characters with their simple version like “à” will be replaces by “a”
Params
- string*-String
The string to process
Return
- -String
The processed string
Example
import { idCompliant } from '@blackbyte/sugar/string';
idCompliant('Hello world'); // => hello-worldTodo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space