Skip to content

Commit 7ff1cce

Browse files
Handle boolean sorthand for filters (#2977)
* Handle boolean sorthand for filters [closes #2966] * Commit the yarn lock
1 parent 3e233dd commit 7ff1cce

File tree

4 files changed

+3917
-3
lines changed

4 files changed

+3917
-3
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ npm-debug.log
1212
.release.json
1313
lerna-debug.log
1414
package-lock.json
15-
yarn.lock

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ node_js:
77
# Use faster Docker architecture on Travis.
88
sudo: false
99

10-
script: npm test
10+
script: yarn test
1111
# TODO: coverage
1212
# after_success: npm run coveralls
1313

packages/pug-filters/lib/handle-filters.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function getAttributes(node, options) {
9494
var attrs = {};
9595
node.attrs.forEach(function (attr) {
9696
try {
97-
attrs[attr.name] = constantinople.toConstant(attr.val);
97+
attrs[attr.name] = attr.val === true ? true : constantinople.toConstant(attr.val);
9898
} catch (ex) {
9999
if (/not constant/.test(ex.message)) {
100100
throw error('FILTER_OPTION_NOT_CONSTANT', ex.message + ' All filters are rendered compile-time so filter options must be constants.', node);

0 commit comments

Comments
 (0)