Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle boolean sorthand for filters #2977

Merged
merged 2 commits into from Mar 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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