Skip to content

Commit

Permalink
fix(docz-core): remove unnescessary Entry.check
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Jul 5, 2018
1 parent 992eef9 commit 1871db8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
4 changes: 1 addition & 3 deletions packages/docz-core/src/Entries.tsx
Expand Up @@ -99,8 +99,6 @@ export class Entries {
Array.isArray(pattern) ? [...pattern, ignoreGlob] : [pattern, ignoreGlob]
)

const isEntry = async (file: string) => Entry.check(file)

const createEntry = async (file: string) => {
const ast = await parseMdx(file)
const { settings, ...entry } = new Entry(ast, file, src)
Expand All @@ -112,7 +110,7 @@ export class Entries {
}

const map = new Map()
const entries = await Promise.all(files.filter(isEntry).map(createEntry))
const entries = await Promise.all(files.map(createEntry))

for (const entry of entries) {
map.set(entry.filepath, entry)
Expand Down
6 changes: 0 additions & 6 deletions packages/docz-core/src/Entry.ts
Expand Up @@ -73,12 +73,6 @@ export interface EntryObj {
export class Entry {
readonly [key: string]: any

public static async check(file: string): Promise<boolean | null> {
const ast = await parseMdx(file)
const parsed = getParsedData(ast)
return Boolean(parsed && parsed.name)
}

public id: string
public filepath: string
public slug: string
Expand Down

0 comments on commit 1871db8

Please sign in to comment.