Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// key = link.startsWith('#') ? path : link.slice(0, hashIndex);
// }
// return {
// key,
// hasHash,
// hashIndex,
// };
// }
// function createPathPrefixer(pathPrefix) {
// return function withPathPrefix(url) {
// const prefixed = pathPrefix + url;
// return prefixed.replace(/\/\//, '/');
// };
// }
let buildFilenameToUrlMap = weakMemoize(getNode =>
weakMemoize(files => {
let map = {};
for (let file of files) {
if (file.children.length === 2) {
map[file.absolutePath] = getNode(file.children[1]).fields.slug;
}
}
return map;
})
);
module.exports = async function plugin(
{ markdownAST, markdownNode, files, getNode, cache, getCache, pathPrefix } // { exceptions = [], ignore = [] } = {}
) {
if (!markdownNode.fields) {