MCPcopy
hub / github.com/angular/components / stringMatches

Method stringMatches

src/cdk/testing/component-harness.ts:633–644  ·  view source on GitHub ↗

* Checks if the specified nullable string value matches the given pattern. * @param value The nullable string value to check, or a Promise resolving to the * nullable string value. * @param pattern The pattern the value is expected to match. If `pattern` is a string, * `value` is exp

(
    value: string | null | Promise<string | null>,
    pattern: string | RegExp | null,
  )

Source from the content-addressed store, hash-verified

631 * @return Whether the value matches the pattern.
632 */
633 static async stringMatches(
634 value: string | null | Promise<string | null>,
635 pattern: string | RegExp | null,
636 ): Promise<boolean> {
637 value = await value;
638 if (pattern === null) {
639 return value === null;
640 } else if (value === null) {
641 return false;
642 }
643 return typeof pattern === 'string' ? value === pattern : pattern.test(value);
644 }
645
646 /**
647 * Adds a predicate function to be run against candidate harnesses.

Callers 15

withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80
withMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected