Skip to content

Commit

Permalink
Shorten the parameter option evalualion
Browse files Browse the repository at this point in the history
  • Loading branch information
borodean committed Mar 3, 2017
1 parent e5e35d9 commit 7916bfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function (url, options, callback) {

var object = options.object || window;
var key = options.key || 'j' + count++;
var parameter = (options.parameter === undefined) ? 'callback' : options.parameter;
var parameter = 'parameter' in options ? options.parameter : 'callback';

var script = document.createElement('script');
script.src = parameter ? (url + (~url.indexOf('?') ? '&' : '?') + parameter + '=' + key) : url; // eslint-disable-line no-implicit-coercion
Expand Down

0 comments on commit 7916bfd

Please sign in to comment.