Skip to main content

globMatch

Small utility used by createBackendStore's whitelist. Supports two wildcards:

  • * — matches a single segment (no .)
  • ** — matches across segments (greedy)
import {matchesAnyGlob} from 'habarico';

matchesAnyGlob('preferences.users.columns', ['preferences.*.columns']); // → true
matchesAnyGlob('preferences.users.foo.columns', ['preferences.*.columns']); // → false (single * is one segment)
matchesAnyGlob('preferences.users.foo.columns', ['preferences.**']); // → true

See also​