Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oniyi-http-plugin-format-url-template

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oniyi-http-plugin-format-url-template - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

lib/utils.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc