Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 1.1 KB

TypeHint.md

File metadata and controls

66 lines (51 loc) · 1.1 KB

TypeHint

GetBaseType

getBaseType(value: any): string

Return a string depending on the type of the given value.

Possible values:

  • undefined
  • null
  • NaN
  • boolean
  • number
  • string
  • array
  • object
  • function
  • generator
  • class

Note: generator refers to a generator function.

GetDetailedType

getDetailedType(value: any): string

Return a string depending on the type of the given value.
Provide more details than GetBaseType.

Possible values:

  • undefined
  • null
  • NaN
  • boolean (true or false)
  • number (N)
  • string (N characters)
  • array (N items)
  • anonymous object
  • object anonymous class
  • object ClassName
  • anonymous function
  • function name
  • anonymous generator
  • generator name
  • anonymous class
  • class Name

Note: generator refers to a generator function.

GetName

getName(value: any): string|undefined

If given a function, generator function, method, or class, return its name.
If given an object, return its constructor name.
If the given value doesn't have a name, return an empty string.
For any other value, return undefined.