@@ -45,6 +45,7 @@ import {
45
45
longestCommonSuffix ,
46
46
longestUncommonInfixes ,
47
47
toKebabCase ,
48
+ toSlugCase ,
48
49
toSuperscript ,
49
50
tverskyDistance ,
50
51
} from "./index.ts" ;
@@ -1228,14 +1229,32 @@ Deno.test("longestUncommonInfixes", () => {
1228
1229
Deno . test ( "toKebabCase" , ( ) => {
1229
1230
const a = toKebabCase ( "Malwa Plateau" ) ;
1230
1231
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 ( "Curaçao São Tomé & Príncipe!" ) ;
1253
+ assertEquals ( b , "curacao-sao-tome-principe" ) ;
1254
+ const c = toSlugCase ( "你好世界 hello world" ) ;
1255
+ assertEquals ( c , "hello-world" ) ;
1256
+ // const d = toSlugCase("Æther & Œuvre — résumé", null, "_");
1257
+ // assertEquals(d, "aether_oeuvre_resume");
1239
1258
} ) ;
1240
1259
1241
1260
0 commit comments