Skip to content

matchesPattern()

@blobs/sdk v0.1.0


@blobs/sdk / events / matchesPattern

matchesPattern(pattern, event): boolean

Defined in: events/WireEventManager.ts:131

Tests whether a wire event name matches a subscription pattern.

Supports three pattern forms:

  • 'blob.created' — exact match.
  • 'blob.*' — any event whose name starts with the prefix (blob.).
  • '*' — global wildcard, matches every event.

Parameters

pattern

string

The subscription pattern.

event

string

The wire event name.

Returns

boolean

true when the pattern matches the event name.