MCPcopy Create free account
hub / github.com/compilets/compilets / getFileType

Method getFileType

src/cpp-project.ts:80–89  ·  view source on GitHub ↗

* Get the type of file according to 'mainFileName' and 'executables'.

(fileName: string)

Source from the content-addressed store, hash-verified

78 * Get the type of file according to 'mainFileName' and 'executables'.
79 */
80 getFileType(fileName: string) {
81 const isExecutable = this.executables &&
82 Object.values(this.executables).includes(fileName);
83 if (this.mainFileName == fileName) {
84 if (isExecutable)
85 throw new Error('Can not specify a file as both module main script and bin script');
86 return 'napi';
87 }
88 return isExecutable ? 'exe' : 'lib';
89 }
90
91 /**
92 * Return all the files this project will generate.

Callers 1

parseSourceFileMethod · 0.80

Calls 1

includesMethod · 0.80

Tested by

no test coverage detected