Skip to content

Commit

Permalink
perf(strings): simplify string default delim regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jan 8, 2021
1 parent b50a0f9 commit bb62760
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/strings/src/split.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
* @param delim
* @param includeDelim
*/
export function* split(
src: string,
delim = /(\r\n)|\n|\r/g,
includeDelim = false
) {
export function* split(src: string, delim = /\r?\n/g, includeDelim = false) {
let i = 0;
const n = src.length;
const include = ~~includeDelim;
Expand Down

0 comments on commit bb62760

Please sign in to comment.