Skip to content

Commit a8d11a8

Browse files
committed
fix: amend browser patches
This change allows to properly apply the patches in situations where the WASM file is served on domain without path. Refs #1035
1 parent b82ee71 commit a8d11a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/apidom-parser-adapter-json/src/lexical-analysis/browser-patch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const realFetch = globalThis.fetch;
99
if (isFunction(realFetch)) {
1010
globalThis.fetch = (...args) => {
1111
// @ts-ignore
12-
if (isString(args[0]) && args[0].endsWith('/tree-sitter.wasm')) {
12+
if (isString(args[0]) && args[0].endsWith('tree-sitter.wasm')) {
1313
// @ts-ignore
1414
return realFetch.apply(globalThis, [treeSitterWasm, tail(args)]);
1515
}

packages/apidom-parser-adapter-yaml-1-2/src/lexical-analysis/browser-patch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const realFetch = globalThis.fetch;
99
if (isFunction(realFetch)) {
1010
globalThis.fetch = (...args) => {
1111
// @ts-ignore
12-
if (isString(args[0]) && args[0].endsWith('/tree-sitter.wasm')) {
12+
if (isString(args[0]) && args[0].endsWith('tree-sitter.wasm')) {
1313
// @ts-ignore
1414
return realFetch.apply(globalThis, [treeSitterWasm, tail(args)]);
1515
}

0 commit comments

Comments
 (0)