Skip to content

Commit c830442

Browse files
committed
refactor: convert instance methods to static for file handling in Project class
1 parent a033217 commit c830442

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

packages/project/src/project.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,17 @@ export class Project {
364364
return jaclyData;
365365
}
366366

367-
private isFlashFile(filePath: string): boolean {
367+
private static isFlashFile(filePath: string): boolean {
368368
const base = path.basename(filePath);
369369
return base === "package.json" || path.extname(filePath) === ".js";
370370
}
371371

372-
private isIgnoredProject(name: string): boolean {
372+
private static isIgnoredProject(name: string): boolean {
373373
const base = path.basename(name);
374374
return base === "node_modules" || base.startsWith(".") || base === "package-lock.json";
375375
}
376376

377-
private isIgnoredModule(name: string): boolean {
377+
private static isIgnoredModule(name: string): boolean {
378378
const base = path.basename(name);
379379
return base.startsWith(".") || base === "package-lock.json";
380380
}
@@ -384,7 +384,7 @@ export class Project {
384384
dirPath: string,
385385
rawPrefix: string = "",
386386
filter?: (f: string) => boolean,
387-
isIgnored: (entryPath: string) => boolean = this.isIgnoredProject.bind(this)
387+
isIgnored: (entryPath: string) => boolean = Project.isIgnoredProject
388388
): Promise<void> {
389389
if (!this.fs.existsSync(dirPath)) return;
390390

@@ -430,8 +430,8 @@ export class Project {
430430
files,
431431
path.join(this.projectPath, "node_modules"),
432432
"node_modules",
433-
this.isFlashFile.bind(this),
434-
this.isIgnoredModule.bind(this)
433+
Project.isFlashFile,
434+
Project.isIgnoredModule
435435
);
436436

437437
await this.collectFiles(files, this.projectPath, "", (filePath: string) => {

0 commit comments

Comments
 (0)