Skip to content

Commit

Permalink
rename helper module
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahs committed Jun 15, 2021
1 parent 8d3375d commit bf23c05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
17 changes: 0 additions & 17 deletions tests/helpers/get-ifversion-conditionals.js

This file was deleted.

11 changes: 11 additions & 0 deletions tests/helpers/get-liquid-conditionals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const { Tokenizer } = require('liquidjs')

module.exports = function getLiquidConditionals (str, tagNames) {
const tokenizer = new Tokenizer(str)

tagNames = Array.isArray(tagNames) ? tagNames : [tagNames]

return tokenizer.readTopLevelTokens()
.filter(token => tagNames.includes(token.name))
.map(token => token.args)
}

0 comments on commit bf23c05

Please sign in to comment.