@pengzhanbo/utils - v3.4.1
    Preparing search index...

    Function isTypeof

    • Checks if a value is of a given type

      检查值是否为给定类型

      Parameters

      • s: unknown

        The value to check. 要检查的值

      • type: string

        The type to check against. 要检查的类型

      Returns boolean

      True if the value is of the given type, false otherwise. 如果值为给定类型则返回true,否则返回false

      isTypeof(null, 'null') // => true
      isTypeof(undefined, 'undefined') // => true
      isTypeof({}, 'object') // => true