mirror of https://github.com/miraclx/freyr-js
compacteq: logical {AND,OR} assignment
This commit is contained in:
parent
88b4530c4e
commit
e86cf55b35
2
cli.js
2
cli.js
|
|
@ -396,7 +396,7 @@ async function init(queries, options) {
|
|||
'-t, --meta-tries',
|
||||
'number',
|
||||
);
|
||||
options.cover = options.cover && xpath.basename(options.cover);
|
||||
options.cover &&= xpath.basename(options.cover);
|
||||
options.chunks = CHECK_FLAG_IS_NUM(options.chunks, '-n, --chunks', 'number');
|
||||
options.timeout = CHECK_FLAG_IS_NUM(options.timeout, '--timeout', 'number');
|
||||
options.bitrate = CHECK_BIT_RATE_VAL(options.bitrate);
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ function hookupListeners() {
|
|||
}
|
||||
|
||||
async function genFile(opts) {
|
||||
opts = opts || {};
|
||||
opts ||= {};
|
||||
if (opts.filename) {
|
||||
opts.tmpdir = opts.tmpdir || tmpdir();
|
||||
opts.tmpdir ||= tmpdir();
|
||||
if (!(await exists(opts.tmpdir))) throw new Error('tmpdir does not exist');
|
||||
const dir = join(opts.tmpdir, opts.dirname || '.');
|
||||
await mkdirp(dir);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class StackLogger {
|
|||
* @param {boolean} [opts.autoTick] Whether or not to auto tick printers.
|
||||
*/
|
||||
constructor(opts) {
|
||||
opts = opts || {};
|
||||
opts ||= {};
|
||||
this.#store.isTTY = opts.isTTY || false;
|
||||
this.#store.persist = opts.persist || false;
|
||||
this.#store.output = opts.output;
|
||||
|
|
|
|||
Loading…
Reference in New Issue