Comparing version 0.0.4 to 0.0.5
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"scripts": { | ||
@@ -22,3 +22,3 @@ "lint": "tslint --project ./tsconfig.json", | ||
"dependencies": { | ||
"url-transformers": "^0.0.3" | ||
"url-transformers": "^0.0.5" | ||
}, | ||
@@ -25,0 +25,0 @@ "devDependencies": { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// tslint:disable-next-line match-default-export-name | ||
var url_transformers_1 = require("url-transformers"); | ||
@@ -30,21 +31,11 @@ var helpers_1 = require("./helpers"); | ||
var serializeImgixUrlQueryParamListValue = pipe_1.pipe(pickTrueObjectKeys, joinWithComma, undefinedIfEmptyString); | ||
var throwErrorIfNotFinite = function (n) { | ||
if (!isFinite(n)) { | ||
var error = new Error('Expected number to be finite'); | ||
throw error; | ||
} | ||
else { | ||
return n; | ||
} | ||
}; | ||
var mapFiniteNumberToStringIfDefined = maybe_1.mapValueIfDefined(pipe_1.pipe(throwErrorIfNotFinite, String)); | ||
var mapToSerializedListValueIfDefined = maybe_1.mapValueIfDefined(serializeImgixUrlQueryParamListValue); | ||
var serializeImgixUrlQueryParamValues = function (query) { | ||
return pipe_1.pipe(function () { return ({ | ||
dpr: mapFiniteNumberToStringIfDefined(query.dpr), | ||
dpr: query.dpr, | ||
auto: mapToSerializedListValueIfDefined(query.auto), | ||
fit: query.fit, | ||
w: mapFiniteNumberToStringIfDefined(query.w), | ||
h: mapFiniteNumberToStringIfDefined(query.h), | ||
q: mapFiniteNumberToStringIfDefined(query.q), | ||
w: query.w, | ||
h: query.h, | ||
q: query.q, | ||
cs: query.cs, | ||
@@ -54,3 +45,3 @@ crop: mapToSerializedListValueIfDefined(query.crop), | ||
ch: mapToSerializedListValueIfDefined(query.ch), | ||
blur: mapFiniteNumberToStringIfDefined(query.blur), | ||
blur: query.blur, | ||
}); }, maybe_1.catMaybesDictionary)({}); | ||
@@ -57,0 +48,0 @@ }; |
Sorry, the diff of this file is not supported yet
13471
175
+ Addedurl-transformers@0.0.5(transitive)
- Removedurl-transformers@0.0.3(transitive)
Updatedurl-transformers@^0.0.5