(file, options, callback = noop)
| 275 | // @param {options} options The options object |
| 276 | // @param {function} callback The callback function |
| 277 | const parseFile = (file, options, callback = noop) => { |
| 278 | if (typeof options === 'function') { |
| 279 | callback = options; |
| 280 | options = {}; |
| 281 | } |
| 282 | file = file || ''; |
| 283 | let s = fs.createReadStream(file, { encoding: 'utf8' }); |
| 284 | s.on('error', callback); |
| 285 | return parseStream(s, options, callback); |
| 286 | }; |
| 287 | |
| 288 | // @param {string} str The G-code text string |
| 289 | // @param {options} options The options object |
no test coverage detected