* Get the type of file according to 'mainFileName' and 'executables'.
(fileName: string)
| 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. |
no test coverage detected