@clocklimited/darkroom-url-builder
Advanced tools
Comparing version 1.7.1 to 1.7.2
@@ -7,3 +7,3 @@ module.exports = getActionHash | ||
var extraAction = Object.keys(extraActions).map(function (key) { | ||
return key + '=' + JSON.stringify(extraActions[key]) | ||
return key + '=' + extraActions[key] | ||
}) | ||
@@ -10,0 +10,0 @@ return hash('md5') |
{ | ||
"name": "@clocklimited/darkroom-url-builder", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "Build URLs for darkroom resources", | ||
@@ -5,0 +5,0 @@ "main": "url-builder.js", |
@@ -63,2 +63,8 @@ module.exports = createBuilder | ||
Builder.prototype.gravity = function (gravity) { | ||
assertString(gravity, 'gravity') | ||
this._gravity = gravity | ||
return this | ||
} | ||
Builder.prototype.info = function () { | ||
@@ -105,2 +111,6 @@ return constructUrl( | ||
if (this._gravity) { | ||
extraActions.gravity = this._gravity | ||
} | ||
return constructUrl( | ||
@@ -120,1 +130,5 @@ this.darkroomHost, | ||
} | ||
function assertString(n, name) { | ||
if (typeof n !== 'string') throw new Error('Expected ' + name + ' to be a string, got "' + typeof n + '"') | ||
} |
10641
150