Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

markmap-view

Package Overview
Dependencies
Maintainers
1
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markmap-view - npm Package Compare versions

Comparing version 0.14.5-alpha.21 to 0.14.5-alpha.22

75

dist/browser/index.js

@@ -1,6 +0,63 @@

/*! markmap-view v0.14.5-alpha.21+fb81f2c | MIT License */
/*! markmap-view v0.14.5-alpha.22+04afb38 | MIT License */
(function (exports, d3) {
'use strict';
/*! markmap-common v0.14.5-alpha.21+fb81f2c | MIT License */
/*! markmap-common v0.14.5-alpha.22+04afb38 | MIT License */
function _extends$1() {
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$1.apply(this, arguments);
}
const testPath = "npm2url/dist/index.cjs";
const defaultProviders = {
jsdelivr: path => `https://cdn.jsdelivr.net/npm/${path}`,
unpkg: path => `https://unpkg.com/${path}`
};
class UrlBuilder {
constructor() {
this.providers = _extends$1({}, defaultProviders);
this.provider = "jsdelivr";
}
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;
}));
}
async findFastestProvider() {
this.provider = await this.getFastestProvider();
return this.provider;
}
setProvider(name, factory) {
if (factory) {
this.providers[name] = factory;
} else {
delete this.providers[name];
}
}
getFullUrl(path, provider = this.provider) {
if (path.includes("://")) {
return path;
}
const factory = this.providers[provider];
if (!factory) {
throw new Error(`Provider ${provider} not found`);
}
return factory(path);
}
}
new UrlBuilder();
class Hook {

@@ -27,16 +84,2 @@ constructor() {

}
function _extends$1() {
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends$1.apply(this, arguments);
}
const uniqId = Math.random().toString(36).slice(2, 8);

@@ -43,0 +86,0 @@ let globalIndex = 0;

@@ -1,2 +0,2 @@

/*! markmap-view v0.14.5-alpha.21+fb81f2c | MIT License */
/*! markmap-view v0.14.5-alpha.22+04afb38 | MIT License */
import { Hook, getId, addClass, walkTree, childSelector, noop } from 'markmap-common';

@@ -3,0 +3,0 @@ export { loadCSS, loadJS } from 'markmap-common';

{
"name": "markmap-view",
"version": "0.14.5-alpha.21+fb81f2c",
"version": "0.14.5-alpha.22+04afb38",
"description": "View markmaps in browser",

@@ -49,3 +49,3 @@ "author": "Gerald <gera2ld@live.com>",

"@types/d3-flextree": "^2.1.1",
"markmap-common": "0.14.5-alpha.21+fb81f2c"
"markmap-common": "0.14.5-alpha.22+04afb38"
},

@@ -55,3 +55,3 @@ "peerDependencies": {

},
"gitHead": "fb81f2cb688f400f17f911774539267219f639ce"
"gitHead": "04afb38dd0a6f3b5e8eaffde3c29e9e38b215c35"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc