@webdeveric/utils
    Preparing search index...
    • Create a type predicate function that checks if input is a string matching the given pattern.

      Type Parameters

      • T extends string

      Parameters

      • pattern: RegExp

      Returns TypePredicateFn<T>

      const isHexColor = matching(/^#[0-9a-f]{6}$/i);
      isHexColor('#ff0000'); // true
      isHexColor('red'); // false