Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @younho9/guards

Index

Functions

Const isArray

  • isArray<T, U>(term: U | T[]): term is T[]
  • Type parameters

    • T

    • U

    Parameters

    • term: U | T[]

    Returns term is T[]

Const isBigInt

  • isBigInt<U>(term: bigint | U): term is bigint
  • Type parameters

    • U

    Parameters

    • term: bigint | U

    Returns term is bigint

Const isBoolean

  • isBoolean<U>(term: boolean | U): term is boolean
  • Type parameters

    • U

    Parameters

    • term: boolean | U

    Returns term is boolean

Const isDate

  • isDate<U>(term: U | Date): term is Date
  • Type parameters

    • U

    Parameters

    • term: U | Date

    Returns term is Date

isFalsy

  • isFalsy(condition: unknown): condition is Falsy
  • Parameters

    • condition: unknown

    Returns condition is Falsy

Const isFunction

  • isFunction<T, U>(term: T | U): term is T
  • Type parameters

    • T: Function

    • U

    Parameters

    • term: T | U

    Returns term is T

Const isInteger

  • isInteger<U>(term: number | U): term is number
  • Type parameters

    • U

    Parameters

    • term: number | U

    Returns term is number

isKeyOf

  • isKeyOf<T>(object: T): (key: PropertyKey) => key is keyof T
  • Type parameters

    • T: object

    Parameters

    • object: T

    Returns (key: PropertyKey) => key is keyof T

      • (key: PropertyKey): key is keyof T
      • Parameters

        • key: PropertyKey

        Returns key is keyof T

Const isMap

  • isMap<K, V, U>(term: U | Map<K, V>): term is Map<K, V>
  • Type parameters

    • K

    • V

    • U

    Parameters

    • term: U | Map<K, V>

    Returns term is Map<K, V>

Const isNegativeInteger

  • isNegativeInteger<U>(term: number | U): term is number
  • Type parameters

    • U

    Parameters

    • term: number | U

    Returns term is number

Const isNonEmptyArray

  • isNonEmptyArray<T, U>(term: U | T[]): term is T[]
  • Type parameters

    • T

    • U

    Parameters

    • term: U | T[]

    Returns term is T[]

Const isNonEmptyString

  • isNonEmptyString<U>(term: string | U): term is string
  • Type parameters

    • U

    Parameters

    • term: string | U

    Returns term is string

Const isNonNegativeInteger

  • isNonNegativeInteger<U>(term: number | U): term is number
  • Type parameters

    • U

    Parameters

    • term: number | U

    Returns term is number

Const isNull

  • isNull<T>(term: null | T): term is null
  • Type parameters

    • T

    Parameters

    • term: null | T

    Returns term is null

isNullish

  • isNullish(value: unknown): value is Nullish
  • Parameters

    • value: unknown

    Returns value is Nullish

Const isNumber

  • isNumber<U>(term: number | U): term is number
  • Type parameters

    • U

    Parameters

    • term: number | U

    Returns term is number

Const isNumberOrNaN

  • isNumberOrNaN<U>(term: number | U): term is number
  • Type parameters

    • U

    Parameters

    • term: number | U

    Returns term is number

Const isObject

  • isObject<T, U>(term: T | U): term is NonNullable<T>
  • Type parameters

    • T: object

    • U

    Parameters

    • term: T | U

    Returns term is NonNullable<T>

Const isObjectOrNull

  • isObjectOrNull<T, U>(term: T | U): term is T
  • Type parameters

    • T: object

    • U

    Parameters

    • term: T | U

    Returns term is T

Const isPositiveInteger

  • isPositiveInteger<U>(term: number | U): term is number
  • Type parameters

    • U

    Parameters

    • term: number | U

    Returns term is number

Const isSet

  • isSet<T, U>(term: U | Set<T>): term is Set<T>
  • Type parameters

    • T

    • U

    Parameters

    • term: U | Set<T>

    Returns term is Set<T>

Const isString

  • isString<U>(term: string | U): term is string
  • Type parameters

    • U

    Parameters

    • term: string | U

    Returns term is string

Const isSymbol

  • isSymbol<U>(term: symbol | U): term is symbol
  • Type parameters

    • U

    Parameters

    • term: symbol | U

    Returns term is symbol

isTruthy

  • isTruthy<T>(condition: Falsy | T): condition is Exclude<T, Falsy>
  • Type parameters

    • T

    Parameters

    • condition: Falsy | T

    Returns condition is Exclude<T, Falsy>

Const isUndefined

  • isUndefined<T>(term: undefined | T): term is undefined
  • Type parameters

    • T

    Parameters

    • term: undefined | T

    Returns term is undefined

Const isWeakMap

  • isWeakMap<K, V, U>(term: U | WeakMap<K, V>): term is WeakMap<K, V>
  • Type parameters

    • K: object

    • V

    • U

    Parameters

    • term: U | WeakMap<K, V>

    Returns term is WeakMap<K, V>

Const isWeakSet

  • isWeakSet<T, U>(term: U | WeakSet<T>): term is WeakSet<T>
  • Type parameters

    • T: object

    • U

    Parameters

    • term: U | WeakSet<T>

    Returns term is WeakSet<T>

Generated using TypeDoc