Closed
Description
- Version: v10.15.0
- Platform: Linux dbiro 4.20.0-arch1-1-ARCH deps: update openssl to 1.0.1j #1 SMP PREEMPT Mon Dec 24 03:00:40 UTC 2018 x86_64 GNU/Linux
- Subsystem: filesystem
Details:
electron-userland/electron-webpack#255
In short:
Here it is the implementation of getOptions:
function getOptions(options, defaultOptions) {
if (options === null || options === undefined ||
typeof options === 'function') {
return defaultOptions;
}
if (typeof options === 'string') {
defaultOptions = util._extend({}, defaultOptions);
defaultOptions.encoding = options;
options = defaultOptions;
} else if (typeof options !== 'object') {
throw new ERR_INVALID_ARG_TYPE('options', ['string', 'Object'], options);
}
if (options.encoding !== 'buffer')
assertEncoding(options.encoding);
return options;
}
But this code is working:
const fsp = require('fs')
fsp.readFile(SOME_VALID_URL, { encoding: 'utf8' })
Metadata
Metadata
Assignees
Labels
No labels