| 186 | } |
| 187 | |
| 188 | function isSameFile(inputFileName, outputFileName) { |
| 189 | if (!inputFileName || !outputFileName) { |
| 190 | return false; |
| 191 | } |
| 192 | |
| 193 | try { |
| 194 | const inputStat = fs.statSync(inputFileName); |
| 195 | const outputStat = fs.statSync(outputFileName); |
| 196 | return inputStat.dev === outputStat.dev && inputStat.ino === outputStat.ino; |
| 197 | } catch (error) { |
| 198 | return path.resolve(process.cwd(), inputFileName) === |
| 199 | path.resolve(process.cwd(), outputFileName); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | function convertStream(converter, options, callback) { |
| 204 | if (isSameFile(options.input, options.output)) { |