pug-filters
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -10,3 +10,4 @@ 'use strict'; | ||
module.exports = handleFilters; | ||
function handleFilters(ast, filters) { | ||
function handleFilters(ast, filters, options) { | ||
options = options || {}; | ||
walk(ast, function (node) { | ||
@@ -18,2 +19,8 @@ var dir = node.filename ? dirname(node.filename) : null; | ||
var attrs = getAttributes(node); | ||
var opts = options[node.name] || {}; | ||
Object.keys(opts).forEach(function (opt) { | ||
if (!attrs.hasOwnProperty(opt)) { | ||
attrs[opt] = opts[opt]; | ||
} | ||
}); | ||
attrs.filename = node.filename; | ||
@@ -20,0 +27,0 @@ node.type = 'Text'; |
{ | ||
"name": "pug-filters", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Code for processing filters in pug templates", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -6,3 +6,3 @@ # pug-filters | ||
[![Build Status](https://img.shields.io/travis/pugjs/pug-filters/master.svg)](https://travis-ci.org/pugjs/pug-filters) | ||
[![Dependency Status](https://img.shields.io/gemnasium/pugjs/pug-filters.svg)](https://gemnasium.com/pugjs/pug-filters) | ||
[![Dependency Status](https://img.shields.io/david/pugjs/pug-filters.svg)](https://david-dm.org/pugjs/pug-filters) | ||
[![NPM version](https://img.shields.io/npm/v/pug-filters.svg)](https://www.npmjs.org/package/pug-filters) | ||
@@ -9,0 +9,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
54500
1672