Charter · API

matchGlob

Returns true if a pattern matches an id and false otherwise. The only wildcard is *, which matches any run of characters, dots included. **, braces and regular expressions are not supported.

Calls
[
  'matchGlob('me.*', 'me.tickets')',
  'matchGlob('me.*', 'members')',
  'matchGlob('*.read', 'bookings.read')',
  'matchGlob('door', 'door.list')',
]
Output
[true, false, true, false]
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.