WIP - add extractor, generate snippet_data

This commit is contained in:
Stefan Fejes
2019-08-20 15:52:05 +02:00
parent 88084d3d30
commit cc8f1d8a7a
37396 changed files with 4588842 additions and 133 deletions

39
node_modules/gatsby/dist/utils/path.js generated vendored Normal file
View File

@ -0,0 +1,39 @@
"use strict";
exports.__esModule = true;
exports.withBasePath = withBasePath;
exports.withTrailingSlash = withTrailingSlash;
exports.getCommonDir = getCommonDir;
const path = require(`path`);
const {
joinPath
} = require(`gatsby-core-utils`);
function withBasePath(basePath) {
return (...paths) => joinPath(basePath, ...paths);
}
function withTrailingSlash(basePath) {
return `${basePath}/`;
}
const posixJoinWithLeadingSlash = paths => path.posix.join(...paths.map((segment, index) => segment === `` && index === 0 ? `/` : segment));
function getCommonDir(path1, path2) {
const path1Segments = path1.split(/[/\\]/);
const path2Segments = path2.split(/[/\\]/);
for (let i = 0; i < path1Segments.length; i++) {
if (i >= path2Segments.length) {
return posixJoinWithLeadingSlash(path2Segments);
} else if (path1Segments[i].toLowerCase() !== path2Segments[i].toLowerCase()) {
const joined = path1Segments.slice(0, i);
return posixJoinWithLeadingSlash(joined);
}
}
return posixJoinWithLeadingSlash(path1Segments);
}
//# sourceMappingURL=path.js.map