Skip to content

Commit

Permalink
core: fix variable duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Feb 20, 2017
1 parent bc8e7fd commit 67726e0
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/license-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,19 @@ class LicensePlugin {
const tmpl = _.template(content);

// Generate the banner.
let banner = tmpl({
_,
moment,
pkg: this._pkg,
dependencies: _.values(this._dependencies),
});
const pkg = this._pkg;
const dependencies = _.values(this._dependencies);
let text = tmpl({_, moment, pkg, dependencies});

// Make a block comment if needed
const trimmedBanner = banner.trim();
const trimmedBanner = text.trim();
const start = trimmedBanner.slice(0, 3);
if (start !== '/**' && start !== '/*!') {
banner = generateBlockComment(banner);
text = generateBlockComment(text);
}

// Prepend the banner.
magicString.prepend(`${banner}${EOL}`);
magicString.prepend(`${text}${EOL}`);
}
}

Expand Down

0 comments on commit 67726e0

Please sign in to comment.