Skip to content

Commit

Permalink
Handle boolean sorthand for filters (#2977)
Browse files Browse the repository at this point in the history
* Handle boolean sorthand for filters

[closes #2966]

* Commit the yarn lock
  • Loading branch information
ForbesLindesay committed Mar 20, 2018
1 parent 3e233dd commit 7ff1cce
Show file tree
Hide file tree
Showing 4 changed files with 3,917 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -12,4 +12,3 @@ npm-debug.log
.release.json
lerna-debug.log
package-lock.json
yarn.lock
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,7 +7,7 @@ node_js:
# Use faster Docker architecture on Travis.
sudo: false

script: npm test
script: yarn test
# TODO: coverage
# after_success: npm run coveralls

Expand Down
2 changes: 1 addition & 1 deletion packages/pug-filters/lib/handle-filters.js
Expand Up @@ -94,7 +94,7 @@ function getAttributes(node, options) {
var attrs = {};
node.attrs.forEach(function (attr) {
try {
attrs[attr.name] = constantinople.toConstant(attr.val);
attrs[attr.name] = attr.val === true ? true : constantinople.toConstant(attr.val);
} catch (ex) {
if (/not constant/.test(ex.message)) {
throw error('FILTER_OPTION_NOT_CONSTANT', ex.message + ' All filters are rendered compile-time so filter options must be constants.', node);
Expand Down

0 comments on commit 7ff1cce

Please sign in to comment.