From fa3ca121de43d2c0549043d7f95392ac2fe1720c Mon Sep 17 00:00:00 2001 From: Finley Baker Date: Mon, 6 Jan 2025 07:18:54 -0700 Subject: [PATCH 1/2] Use `SafeRexExp` for separator module --- ext/node/polyfills/path/separator.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/node/polyfills/path/separator.ts b/ext/node/polyfills/path/separator.ts index bb9eaf7bb4..4f438992be 100644 --- a/ext/node/polyfills/path/separator.ts +++ b/ext/node/polyfills/path/separator.ts @@ -1,9 +1,11 @@ // Copyright 2018-2025 the Deno authors. MIT license. -// TODO(petamoriken): enable prefer-primordials for node polyfills -// deno-lint-ignore-file prefer-primordials - +import { primordials } from "ext:core/mod.js"; import { isWindows } from "ext:deno_node/_util/os.ts"; +const { SafeRegExp } = primordials; + export const SEP = isWindows ? "\\" : "/"; -export const SEP_PATTERN = isWindows ? /[\\/]+/ : /\/+/; +export const SEP_PATTERN = isWindows + ? new SafeRegExp("[\\/]+") + : new SafeRegExp("\/+"); From ac881e318c3519f5593b98f2b4d72844a3f7a961 Mon Sep 17 00:00:00 2001 From: Finley Baker Date: Thu, 9 Jan 2025 08:24:09 -0700 Subject: [PATCH 2/2] Trigger build