File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,10 @@ const cleaned = removeSuffix(".js", "script.js"); // "script"
110110// String joining and splitting
111111const path = join (" /" , " home" , " user" , " docs" ); // "/home/user/docs"
112112const parts = split (" -" , " hello-world-js" ); // ["hello", "world", "js"]
113+
114+ // Split string by line breaks (handles both \n and \r\n)
115+ const lines = splitByLineBreak (" line1\n line2\r\n line3" );
116+ console .log (lines ); // ["line1", "line2", "line3"]
113117```
114118
115119#### Promise Utilities
@@ -499,6 +503,7 @@ Common utilities for everyday programming tasks:
499503export {
500504 template ,
501505 unindent ,
506+ indent ,
502507 addPrefix ,
503508 addSuffix ,
504509 removePrefix ,
@@ -508,6 +513,7 @@ export {
508513 splitWithSlash ,
509514 joinWithSlash ,
510515 toForwardSlash ,
516+ splitByLineBreak ,
511517 concatTemplateStrings ,
512518};
513519
You can’t perform that action at this time.
0 commit comments