Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Join the paths
combinedDetails.path = slash(path.join(u1Details.path, u2Details.path));
// Join query parameters
combinedDetails.query = combineQueryParams(u1Details.query, u2Details.query);
} else {
combinedDetails = u2Details;
}
}
// Remove the fragment
combinedDetails.fragment = undefined;
// For relative URIs, add back the '..' since it was removed above
return (remoteUriTypes.indexOf(combinedDetails.reference) === -1 &&
combinedDetails.path.indexOf('../') === 0 ? '../' : '') + URI.serialize(combinedDetails);
}
function _getFullPath(p) {
return URI.serialize(p).split('#')[0] + '#';
}
function embed(uri, node, whitelist = '', debug = () => {}) {
if ((uri.scheme === 'http' || uri.scheme === 'https') && mm.some(uri.host, whitelist.split(','))) {
const children = [{ ...node }];
node.type = 'embed';
node.children = children;
node.url = URI.serialize(uri);
if (node.value) {
delete node.value;
}
} else {
debug(`Whitelist forbids embedding of URL: ${URI.serialize(uri)}`);
}
}
function _getFullPath(p) {
return URI.serialize(p).split('#')[0] + '#';
}
function _getFullPath(p) {
return URI.serialize(p).split('#')[0] + '#';
}
return function handler(h, node) {
const n = { ...node };
const uriParts = uri.parse(n.url);
if (!uriParts.scheme && uriParts.path) {
uriParts.path = uriParts.path.replace(/\.md$/, `.${extension}`);
n.url = uri.serialize(uriParts);
}
return fallback(h, n);
};
}
function correctUrl(url) {
var u = URI.parse(url);
if(isChrome()) {
u.host = "localhost";
}
return URI.serialize(u);
}
load(uri) {
return axios.get(uriJs.serialize(uri)).then(response => response.data)
}
}