Remove addLeadingSlash util

This commit is contained in:
Michael Jackson
2019-07-10 21:59:23 -07:00
parent b2d8e28344
commit ab83549744
4 changed files with 35 additions and 48 deletions

View File

@ -1,7 +1,5 @@
import path from 'path';
import addLeadingSlash from '../utils/addLeadingSlash.js';
function getMatchingEntries(entry, entries) {
const dirname = entry.name || '.';
@ -10,9 +8,11 @@ function getMatchingEntries(entry, entries) {
.map(name => entries[name]);
}
const leadingSlashes = /^\/*/;
function getMetadata(entry, entries) {
const metadata = {
path: addLeadingSlash(entry.name),
path: entry.name.replace(leadingSlashes, '/'),
type: entry.type
};