@@ -45,6 +45,7 @@ import {
4545 longestCommonSuffix ,
4646 longestUncommonInfixes ,
4747 toKebabCase ,
48+ toSlugCase ,
4849 toSuperscript ,
4950 tverskyDistance ,
5051} from "./index.ts" ;
@@ -1228,14 +1229,36 @@ 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+ // const h = toKebabCase("I can't believe it's not butter!");
1245+ // assertEquals(h, "i-cant-believe-its-not-butter");
1246+ } ) ;
1247+
1248+
1249+
1250+
1251+ Deno . test ( "toSlugCase" , ( ) => {
1252+ const a = toSlugCase ( "Malwa Plateau" ) ;
1253+ assertEquals ( a , "malwa-plateau" ) ;
1254+ const b = toSlugCase ( "malwaPlateau" ) ;
1255+ assertEquals ( b , "malwa-plateau" ) ;
1256+ const c = toSlugCase ( "Curaçao São Tomé & Príncipe!" ) ;
1257+ assertEquals ( c , "curacao-sao-tome-principe" ) ;
1258+ const d = toSlugCase ( "你好世界 hello world" ) ;
1259+ assertEquals ( d , "hello-world" ) ;
1260+ // const e = toSlugCase("Æther & Œuvre — résumé", null, "_");
1261+ // assertEquals(e, "aether_oeuvre_resume");
12391262} ) ;
12401263
12411264
0 commit comments