@@ -45,6 +45,7 @@ import {
4545 longestCommonSuffix ,
4646 longestUncommonInfixes ,
4747 toKebabCase ,
48+ toSlugCase ,
4849 toSuperscript ,
4950 tverskyDistance ,
5051} from "./index.ts" ;
@@ -1228,14 +1229,34 @@ Deno.test("longestUncommonInfixes", () => {
12281229Deno . test ( "toKebabCase" , ( ) => {
12291230 const a = toKebabCase ( "Malwa Plateau" ) ;
12301231 assertEquals ( a , "malwa-plateau" ) ;
1231- const b = toKebabCase ( "::chota::nagpur::" , null , "_" ) ;
1232- assertEquals ( b , "chota_nagpur" ) ;
1233- const c = toKebabCase ( "deccan___plateau" , / _ + / g, "." ) ;
1234- assertEquals ( c , "deccan.plateau" ) ;
1235- const d = toKebabCase ( "Some text_with-mixed CASE" ) ;
1236- assertEquals ( d , "some-text-with-mixed-case" ) ;
1237- const e = toKebabCase ( "IAmListeningToFMWhileLoadingDifferentURL" ) ;
1238- assertEquals ( e , "i-am-listening-to-fm-while-loading-different-url" ) ;
1232+ const b = toKebabCase ( "malwaPlateau" ) ;
1233+ assertEquals ( b , "malwa-plateau" ) ;
1234+ const c = toKebabCase ( "::chota::nagpur::" , null , "_" ) ;
1235+ assertEquals ( c , "chota_nagpur" ) ;
1236+ const d = toKebabCase ( "deccan___plateau" , / _ + / g, "." ) ;
1237+ assertEquals ( d , "deccan.plateau" ) ;
1238+ const e = toKebabCase ( "Some text_with-mixed CASE" ) ;
1239+ assertEquals ( e , "some-text-with-mixed-case" ) ;
1240+ const f = toKebabCase ( "someTextWithMixedCase" ) ;
1241+ assertEquals ( f , "some-text-with-mixed-case" ) ;
1242+ const g = toKebabCase ( "IAmListeningToFMWhileLoadingDifferentURL" ) ;
1243+ assertEquals ( g , "i-am-listening-to-fm-while-loading-different-url" ) ;
1244+ } ) ;
1245+
1246+
1247+
1248+
1249+ Deno . test ( "toSlugCase" , ( ) => {
1250+ const a = toSlugCase ( "Malwa Plateau" ) ;
1251+ assertEquals ( a , "malwa-plateau" ) ;
1252+ const b = toSlugCase ( "malwaPlateau" ) ;
1253+ assertEquals ( b , "malwa-plateau" ) ;
1254+ const c = toSlugCase ( "Curaçao São Tomé & Príncipe!" ) ;
1255+ assertEquals ( c , "curacao-sao-tome-principe" ) ;
1256+ const d = toSlugCase ( "你好世界 hello world" ) ;
1257+ assertEquals ( d , "hello-world" ) ;
1258+ // const e = toSlugCase("Æther & Œuvre — résumé", null, "_");
1259+ // assertEquals(e, "aether_oeuvre_resume");
12391260} ) ;
12401261
12411262
0 commit comments