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

jstransformer-twig

Package Overview
Dependencies
Maintainers
5
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jstransformer-twig - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

4

HISTORY.md
# Changelog
## v1.1.2: 2016-11-16
- Allow for associative arrays of filter modules
## v1.1.1: 2016-11-16

@@ -4,0 +8,0 @@

27

index.js

@@ -26,7 +26,20 @@ 'use strict';

for (var name in options.filters || {}) {
var filter = null;
switch (typeof options.filters[name]) {
case "string":
case 'string':
try {
filter = require(options.filters[name]);
// Load the filter module.
var out = require(options.filters[name]);
// Check if the module is just a function.
if (typeof out === 'function') {
Twig.extendFilter(name, out)
}
// Perhaps it is an associative array of functions?
else if (out && (typeof out === 'object')) {
for (var outName in out) {
if (typeof out[outName] === 'function') {
Twig.extendFilter(outName, out[outName])
}
}
}
}

@@ -37,10 +50,6 @@ catch(err) {

break;
case "function":
default:
filter = options.filters[name];
case 'function':
Twig.extendFilter(name, options.filters[name]);
break;
}
if (filter) {
Twig.extendFilter(name, filter);
}
}

@@ -47,0 +56,0 @@

{
"name": "jstransformer-twig",
"version": "1.1.1",
"version": "1.1.2",
"description": "Twig.js support for JSTransformers.",

@@ -15,2 +15,3 @@ "dependencies": {

"devDependencies": {
"phone-formatter": "0.0.2",
"slugify": "^1.0.2",

@@ -17,0 +18,0 @@ "test-jstransformer": "^1.0.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