Skip to content

Commit bb0391b

Browse files
committed
feat: jsdocs for loaders
1 parent e85e3d8 commit bb0391b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/lib/loaders/directoryLoader.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ import * as fs from 'fs';
22
import * as path from 'path';
33
import { Util } from '../util/Util';
44

5-
export async function directoryLoader(dir: string): Promise<Array<any>> {
5+
/**
6+
* The method that loads all files from a directory
7+
* @param {string} dir The directory to load
8+
* @returns {Promise<any[]>}
9+
*/
10+
export async function directoryLoader(dir: string): Promise<any[]> {
611
let files = [];
712
if (fs.existsSync(dir)) {
813
for await (const fsDirent of fs.readdirSync(dir, { withFileTypes: true })) {

src/lib/loaders/pluginFinder.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import * as fs from 'node:fs';
22
import * as path from 'node:path';
33

4+
/**
5+
* The method that loads plugin files from a directory
6+
* @param basedir The base plugin directory
7+
* @param folder The plugin folder
8+
*/
49
export async function loadPluginFolder(basedir: string, folder: fs.Dirent) {
510
if (folder.isDirectory()) {
611
if (fs.existsSync(path.join(basedir, folder.name, 'index.js'))) {
@@ -19,6 +24,10 @@ export async function loadPluginFolder(basedir: string, folder: fs.Dirent) {
1924
}
2025
}
2126

27+
/**
28+
* The method that find all plugins in a directory
29+
* @param {string} basedir The directory to find plugins in
30+
*/
2231
export async function pluginFinder(basedir: string) {
2332
if (fs.existsSync(basedir)) {
2433
if (fs.existsSync(path.join(basedir, 'plugins'))) {

0 commit comments

Comments
 (0)