const kebab = value =>
value.replace( /([A-Z])/g, '-$1' )
.replace( /_/g, '-' )
.replace( /(-+)/g, '-' )
.toLowerCase();
console.log(kebab('myLongNameVar')); // my-long-name-var
console.log(kebab('my_long_name_var')); // my-long-name-var
console.log(kebab('my_Long_Name_Var')); // my-long-name-var