ivanhofer/typesafe-utils

isObject method

ivanhofer opened this issue · 0 comments

usecase:

const toTest : {} | string = ...
if (isObject(toTest)) {
 const copy = {...toTest} // TS should recognize that `toTest` is an `object`
}

other functions:

  • isString
  • isNumber
  • isArray
  • isDate