Skip to content

Commit

Permalink
add some missing types
Browse files Browse the repository at this point in the history
  • Loading branch information
a-hariti committed Feb 27, 2024
1 parent ebea37e commit 4c1946b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const walkDir = fullPath => {

const pathJoinPrefix = prefix => extraPath => path.join(prefix, extraPath);

/**
* @returns {string[]} - Array of file paths
**/
const getAllFilesRecursively = folder =>
pipe(fs.readdirSync, map(pipe(pathJoinPrefix(folder), walkDir)), flattenArray)(folder);

Expand Down
4 changes: 2 additions & 2 deletions src/mdx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import remarkVariables from './remark-variables';

const root = process.cwd();

function formatSlug(slug) {
function formatSlug(slug: string) {
return slug.replace(/\.(mdx|md)/, '');
}
const isSupported = (
Expand Down Expand Up @@ -205,7 +205,7 @@ export function getAllFilesFrontMatter(folder: string = 'docs'): FrontMatter[] {
return allFrontMatter;
}

export async function getFileBySlug(slug) {
export async function getFileBySlug(slug: string) {
const configPath = path.join(root, slug, 'config.yml');
let configFrontmatter: {[key: string]: any} | undefined;
if (fs.existsSync(configPath)) {
Expand Down

0 comments on commit 4c1946b

Please sign in to comment.