message: fix: Address various publish-canary.js bugs
  * fix: Hoist preid variable in publish-canary
  Otherwise it doesn't exist when used in the last successful promise cb
  * fix: Replace arithmetic with logical operator
diff: #!/usr/bin/env node
  +// @ts-check
  'use strict';
  const request = require('request');
  @@ -14,7 +15,9 @@ const {
  const isPrerelease = TRAVIS_BRANCH.match(/^prerelease\/v\d*$/g);
  const data = {};
  +
  let distTag;
  +let preid;
  if (TRAVIS_BRANCH === 'master') {
  distTag = 'next';
  @@ -67,12 +70,12 @@ cmd('git diff --name-only HEAD HEAD^')
  const nextReleaseVersion = semver.inc(releaseTag, 'prerelease', 'beta'); // eg. 4.0.0-beta.3 > 4.0.0-beta.4
  const nextReleasePreid = nextReleaseVersion.split('-')[1];
  - if (isPrerelease & !nextReleasePreid) {
  + if (isPrerelease && !nextReleasePreid) {
  console.error('Failed to calculate prerelease canary version. Exiting');
  process.exit(1);
  }
  - const preid = isPrerelease ? `${nextReleasePreid}-next` : 'next';
  + preid = isPrerelease ? `${nextReleasePreid}-next` : 'next';
  const lernaFlags = [
  `--yes`,
  