MCPcopy
hub / github.com/markmap/markmap / patchJSItem

Function patchJSItem

packages/markmap-lib/src/util.ts:3–14  ·  view source on GitHub ↗
(urlBuilder: UrlBuilder, item: JSItem)

Source from the content-addressed store, hash-verified

1import { CSSItem, JSItem, UrlBuilder } from 'markmap-common';
2
3export function patchJSItem(urlBuilder: UrlBuilder, item: JSItem): JSItem {
4 if (item.type === 'script' && item.data.src) {
5 return {
6 ...item,
7 data: {
8 ...item.data,
9 src: urlBuilder.getFullUrl(item.data.src),
10 },
11 };
12 }
13 return item;
14}
15
16export function patchCSSItem(urlBuilder: UrlBuilder, item: CSSItem): CSSItem {
17 if (item.type === 'stylesheet' && item.data.href) {

Callers 4

resolveJSMethod · 0.90
transformFunction · 0.90
transformFunction · 0.90
transformFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected