Match Helpers

Table of Contents

match

Visit the: code | unit tests

{match}

Returns an array of strings that match the given glob pattern(s). Options may be passed on the options hash or locals.

Params

  • files Array|String
  • patterns Array|String: One or more glob patterns.
  • locals Object
  • options Object
  • returns Array: Array of matches

Example

{{match (readdir "foo") "*.js"}}
{{match (readdir "foo") (toRegex "\\.js$")}}

{isMatch}

Returns true if a filepath contains the given pattern. Options may be passed on the options hash or locals.

Params

  • filepath String
  • pattern String
  • options Object
  • returns Boolean

Example

{{isMatch "foo.md" "*.md"}}

Table of Contents