New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json-templater

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-templater - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

2

package.json
{
"name": "json-templater",
"version": "1.0.4",
"version": "1.1.0",
"description": "Simple json/js object template strings",

@@ -5,0 +5,0 @@ "main": "template.js",

@@ -39,2 +39,8 @@ suite('string', function() {

verify(
'nested token false value',
['{{foo.bar}}', { foo: { bar: false} }],
'false'
);
verify(
'replace in the middle of string',

@@ -41,0 +47,0 @@ [

@@ -56,17 +56,18 @@ /**

var result;
var replaced = input.replace(REGEX, function(whole, path) {
var replaced = input.replace(REGEX, function(original, path) {
var value = extractValue(path, view);
if (value) {
if (typeof value === 'object') {
result = value;
return;
} else {
return value;
}
if (undefined === value || null === value) {
return original;
}
return whole;
if (typeof value === 'object') {
result = value;
return;
}
return value;
});
return result ? result : replaced;
return (undefined !== result) ? result : replaced;
}
module.exports = replace;
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