From 805d4d7ed9ba93443ccb24781f03bdec12381805 Mon Sep 17 00:00:00 2001 From: alexander-akait Date: Sun, 13 Sep 2026 12:12:19 +0000 Subject: [PATCH] fix: sync the `absolutePath` file URL prefix with schema-utils The hoisted copy wanted exactly two slashes and a lower-case scheme, so a pre-compiled schema rejected `file:/abs` and `FILE:///abs` where the real keyword now takes both. The lookahead leaves the first slash to the path part, keeping a scheme with nothing absolute after it rejected. --- precompile-schemas/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/precompile-schemas/index.js b/precompile-schemas/index.js index 69f356a..7cea498 100644 --- a/precompile-schemas/index.js +++ b/precompile-schemas/index.js @@ -131,7 +131,7 @@ const postprocess = async (code) => { // Keep in sync with the `absolutePath` keyword of `schema-utils`, the // pre-compiled schema has to accept exactly what the real one accepts if (/absolutePathRegExp/.test(code)) - code = `const absolutePathRegExp = /^(?:file:\\/\\/)?(?:[A-Za-z]:[\\\\/]|\\\\\\\\|\\/)/;${code}`; + code = `const absolutePathRegExp = /^(?:file:(?=\\/))?(?:[A-Za-z]:[\\\\/]|\\\\\\\\|\\/)/i;${code}`; // remove unnecessary error code: code = code