Skip to content

Commit

Permalink
Uses boolifyWithDefaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Maël Nison committed Oct 2, 2018
1 parent 5dd3e6c commit 026ff3e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/config.js
Expand Up @@ -6,6 +6,7 @@ import type {Manifest, PackageRemote, WorkspacesManifestMap, WorkspacesConfig} f
import type PackageReference from './package-reference.js';
import {execFromManifest} from './util/execute-lifecycle-script.js';
import {resolveWithHome} from './util/path.js';
import {boolifyWithDefault} from './util/conversion.js';
import normalizeManifest from './util/normalize-manifest/index.js';
import {MessageError} from './errors.js';
import * as fs from './util/fs.js';
Expand Down Expand Up @@ -408,8 +409,6 @@ export default class Config {
}
}

const toBool = value => value !== 'false' && value !== 'no' && value !== '0';

this.plugnplayShebang = String(this.getOption('plugnplay-shebang') || '') || '/usr/bin/env node';
this.plugnplayBlacklist = String(this.getOption('plugnplay-blacklist') || '') || null;

Expand All @@ -424,7 +423,7 @@ export default class Config {
this.linkFileDependencies = Boolean(this.getOption('yarn-link-file-dependencies'));
this.packBuiltPackages = Boolean(this.getOption('experimental-pack-script-packages-in-mirror'));

this.autoAddIntegrity = !toBool(this.getOption('unsafe-disable-integrity-migration') || 'true');
this.autoAddIntegrity = !boolifyWithDefault(this.getOption('unsafe-disable-integrity-migration'), 'true');

//init & create cacheFolder, tempFolder
this.cacheFolder = path.join(this._cacheRootFolder, 'v' + String(constants.CACHE_VERSION));
Expand Down

0 comments on commit 026ff3e

Please sign in to comment.