fix a few more bugs
This commit is contained in:
parent
6ccbb6537e
commit
c3dd11e7e2
@ -6,7 +6,7 @@ import { toString } from 'mdast-util-to-string'
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
|
||||||
import * as dirTree from 'directory-tree'
|
const dirTree = require("directory-tree");
|
||||||
|
|
||||||
class Util {
|
class Util {
|
||||||
_counter
|
_counter
|
||||||
@ -229,12 +229,12 @@ class Util {
|
|||||||
const children = []
|
const children = []
|
||||||
const slugs = this.getAllSlugs()
|
const slugs = this.getAllSlugs()
|
||||||
|
|
||||||
function findFunc(slug) {
|
function findFunc(_this, slug) {
|
||||||
const fileName = Transformer.parseFileNameFromPath(this.toFilePath(slug))
|
const fileName = Transformer.parseFileNameFromPath(_this.toFilePath(slug))
|
||||||
return Transformer.normalizeFileName(fileName) === Transformer.normalizeFileName(thisObject.name)
|
return Transformer.normalizeFileName(fileName) === Transformer.normalizeFileName(thisObject.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
const foundSlugs = slugs.find(slug => findFunc(slug))
|
const foundSlugs = slugs.find(slug => findFunc(this, slug))
|
||||||
|
|
||||||
let routerPath = foundSlugs !== (null | undefined) ? foundSlugs : null
|
let routerPath = foundSlugs !== (null | undefined) ? foundSlugs : null
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@
|
|||||||
"cytoscape": "latest",
|
"cytoscape": "latest",
|
||||||
"eslint": "^8.0.1",
|
"eslint": "^8.0.1",
|
||||||
"eslint-config-next": "latest",
|
"eslint-config-next": "latest",
|
||||||
"postcss": "^8.4.32",
|
|
||||||
"remark-frontmatter": "latest",
|
"remark-frontmatter": "latest",
|
||||||
"remark-react": "latest",
|
"remark-react": "latest",
|
||||||
"remark-stringify": "latest",
|
"remark-stringify": "latest",
|
||||||
|
Loading…
Reference in New Issue
Block a user