markmap-common
Advanced tools
Comparing version 0.14.5-alpha.13 to 0.14.5-alpha.15
@@ -1,2 +0,2 @@ | ||
/*! markmap-common v0.14.5-alpha.13+50ca560 | MIT License */ | ||
/*! markmap-common v0.14.5-alpha.15+1fe26c8 | MIT License */ | ||
'use strict'; | ||
@@ -287,2 +287,3 @@ | ||
provider = await getFastestProvider(); | ||
return provider; | ||
} | ||
@@ -294,20 +295,21 @@ function setProvider(name, factory) { | ||
provider = name; | ||
return provider; | ||
} | ||
function getFullUrl(path) { | ||
function getFullUrl(path, overrideProvider = provider) { | ||
if (path.includes('://')) return path; | ||
return cdnUrl(provider, path); | ||
return cdnUrl(overrideProvider, path); | ||
} | ||
function buildJSItem(path) { | ||
function buildJSItem(path, overrideProvider) { | ||
return { | ||
type: 'script', | ||
data: { | ||
src: getFullUrl(path) | ||
src: getFullUrl(path, overrideProvider) | ||
} | ||
}; | ||
} | ||
function buildCSSItem(path) { | ||
function buildCSSItem(path, overrideProvider) { | ||
return { | ||
type: 'stylesheet', | ||
data: { | ||
href: getFullUrl(path) | ||
href: getFullUrl(path, overrideProvider) | ||
} | ||
@@ -314,0 +316,0 @@ }; |
{ | ||
"name": "markmap-common", | ||
"version": "0.14.5-alpha.13+50ca560", | ||
"version": "0.14.5-alpha.15+1fe26c8", | ||
"description": "", | ||
@@ -36,3 +36,3 @@ "author": "", | ||
}, | ||
"gitHead": "50ca5603019498f93dba6485c96d0a5630b221e5" | ||
"gitHead": "1fe26c8234296e2188e466c7b9dbf3b7e171857d" | ||
} |
import { JSItem, JSScriptItem, CSSItem, CSSStylesheetItem } from './types'; | ||
export declare function loadJS(items: JSItem[], context?: object): Promise<void>; | ||
export declare function loadCSS(items: CSSItem[]): void; | ||
export declare function findFastestProvider(): Promise<void>; | ||
export declare function setProvider(name: string, factory?: (path: string) => string): void; | ||
export declare function getFullUrl(path: string): string; | ||
export declare function buildJSItem(path: string): JSScriptItem; | ||
export declare function buildCSSItem(path: string): CSSStylesheetItem; | ||
export declare function findFastestProvider(): Promise<string>; | ||
export declare function setProvider(name: string, factory?: (path: string) => string): string; | ||
export declare function getFullUrl(path: string, overrideProvider?: string): string; | ||
export declare function buildJSItem(path: string, overrideProvider?: string): JSScriptItem; | ||
export declare function buildCSSItem(path: string, overrideProvider?: string): CSSStylesheetItem; |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
24865
808