@webdeveric/utils
    Preparing search index...
    • Create a type predicate function that checks if input's typeof matches one of the given types.

      Type Parameters

      Parameters

      • ...types: T[]

      Returns <Input>(input: Input) => input is Input & TypeOfMapping[T]

      const isStringOrNumber = typeOf('string', 'number');
      isStringOrNumber('hello'); // true
      isStringOrNumber(5); // true
      isStringOrNumber(true); // false