Skip to content

Commit

Permalink
Don't require opts argument everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebmaster committed Sep 10, 2015
1 parent 454ce97 commit 23c9995
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ function createNumberConversion(bitLength, opts) {
const moduloBound = opts.moduloBitLength ? Math.pow(2, opts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);

return function(V, opts) {
if (!opts) opts = {};

let x = +V;

if (opts.enforceRange) {
Expand Down Expand Up @@ -110,6 +112,8 @@ conversions["float"] = conversions["double"];
conversions["unrestricted float"] = conversions["unrestricted double"];

conversions["DOMString"] = function (V, opts) {
if (!opts) opts = {};

if (opts.treatNullAsEmptyString && V === null) {
return "";
}
Expand Down

0 comments on commit 23c9995

Please sign in to comment.