markmap-view
Advanced tools
Comparing version 0.15.0 to 0.15.3-alpha.1
@@ -1,6 +0,6 @@ | ||
/*! markmap-view v0.15.0 | MIT License */ | ||
/*! markmap-view v0.15.3-alpha.1+fb5e189 | MIT License */ | ||
(function (exports, d3) { | ||
'use strict'; | ||
/*! markmap-common v0.15.0 | MIT License */ | ||
/*! markmap-common v0.15.3-alpha.1+fb5e189 | MIT License */ | ||
function _extends$1() { | ||
@@ -30,14 +30,19 @@ _extends$1 = Object.assign ? Object.assign.bind() : function (target) { | ||
} | ||
getFastestProvider(path = testPath) { | ||
return Promise.any(Object.entries(this.providers).map(async ([name, factory]) => { | ||
const res = await fetch(factory(path)); | ||
if (!res.ok) { | ||
throw res; | ||
} | ||
await res.text(); | ||
return name; | ||
})); | ||
getFastestProvider(timeout = 5e3, path = testPath) { | ||
return new Promise((resolve, reject) => { | ||
Promise.all(Object.entries(this.providers).map(async ([name, factory]) => { | ||
try { | ||
const res = await fetch(factory(path)); | ||
if (!res.ok) { | ||
throw res; | ||
} | ||
await res.text(); | ||
resolve(name); | ||
} catch (_unused) {} | ||
})).then(() => reject(new Error("All providers failed"))); | ||
setTimeout(reject, timeout, new Error("Timed out")); | ||
}); | ||
} | ||
async findFastestProvider() { | ||
this.provider = await this.getFastestProvider(); | ||
async findFastestProvider(timeout) { | ||
this.provider = await this.getFastestProvider(timeout); | ||
return this.provider; | ||
@@ -1234,3 +1239,3 @@ } | ||
let recursive = this.options.toggleRecursively; | ||
if (e.ctrlKey) recursive = !recursive; | ||
if (isMacintosh ? e.metaKey : e.ctrlKey) recursive = !recursive; | ||
this.toggleNode(d.data, recursive); | ||
@@ -1237,0 +1242,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
/*! markmap-view v0.15.0 | MIT License */ | ||
/*! markmap-view v0.15.3-alpha.1+fb5e189 | MIT License */ | ||
import { Hook, getId, addClass, walkTree, childSelector, noop } from 'markmap-common'; | ||
@@ -873,3 +873,3 @@ export { loadCSS, loadJS } from 'markmap-common'; | ||
let recursive = this.options.toggleRecursively; | ||
if (e.ctrlKey) recursive = !recursive; | ||
if (isMacintosh ? e.metaKey : e.ctrlKey) recursive = !recursive; | ||
this.toggleNode(d.data, recursive); | ||
@@ -876,0 +876,0 @@ }; |
{ | ||
"name": "markmap-view", | ||
"version": "0.15.0", | ||
"version": "0.15.3-alpha.1+fb5e189", | ||
"description": "View markmaps in browser", | ||
@@ -49,3 +49,3 @@ "author": "Gerald <gera2ld@live.com>", | ||
"@types/d3-flextree": "^2.1.1", | ||
"markmap-common": "0.15.0" | ||
"markmap-common": "0.15.3-alpha.1+fb5e189" | ||
}, | ||
@@ -55,3 +55,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "9c13bae5e28346ec613362046a023839ef64538b" | ||
"gitHead": "fb5e1891c9cfda0426feb8f43555f32c56648f10" | ||
} |
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
97814
2959
2