oniyi-http-plugin-format-url-template
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -57,3 +57,3 @@ 'use strict'; | ||
return _.toString((!_.isUndefined(mappedVal) && mappedVal) || val); | ||
return _.toString(!_.isUndefined(mappedVal) ? mappedVal : val); | ||
}); | ||
@@ -60,0 +60,0 @@ |
{ | ||
"name": "oniyi-http-plugin-format-url-template", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Plugin for injecting template values into request href and/or query string", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -27,7 +27,7 @@ 'use strict'; | ||
test('renderTemplate replaces templateStrings with values from valuesMap if not undefined', (t) => { | ||
const template = '/foo/{ bar }'; | ||
const templateValues = { bar: 'baz' }; | ||
const valuesMap = { bar: { baz: 'woohoo' } }; | ||
const template = '/foo/{ empty }/{ bar }'; | ||
const templateValues = { bar: 'baz', empty: 'empty-string' }; | ||
const valuesMap = { bar: { baz: 'woohoo' }, empty: { 'empty-string': '' } }; | ||
const result = renderTemplate(template, templateValues, valuesMap); | ||
t.is(result, '/foo/woohoo'); | ||
t.is(result, '/foo//woohoo'); | ||
}); | ||
@@ -34,0 +34,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34430