From bb62760f2069a1f7edeaa09ce0e0639047789af3 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Fri, 8 Jan 2021 00:41:15 +0000 Subject: [PATCH] perf(strings): simplify string default delim regexp --- packages/strings/src/split.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/strings/src/split.ts b/packages/strings/src/split.ts index 657a11ac2e..de4efc39b6 100644 --- a/packages/strings/src/split.ts +++ b/packages/strings/src/split.ts @@ -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;