Skip to content

Commit b436fb9

Browse files
committed
Feat(data:Js): Add utility function to convert strings to param-case
1 parent 791e024 commit b436fb9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

public/data/javascript.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,20 @@
259259
],
260260
"tags": ["string", "case", "pascalCase"],
261261
"author": "aumirza"
262+
},
263+
{
264+
"title": "Convert String to Param Case",
265+
"description": "Converts a given string into param-case.",
266+
"code": [
267+
"function toParamCase(str) {",
268+
" return str.toLowerCase().replace(/\\s+/g, '-');",
269+
"}",
270+
"",
271+
"// Example usage:",
272+
"console.log(toParamCase('Hello World Test')); // Output: 'hello-world-test'"
273+
],
274+
"tags": ["string", "case", "paramCase"],
275+
"author": "aumirza"
262276
},
263277
{
264278
"title": "Remove Vowels from a String",

0 commit comments

Comments
 (0)