ivanhofer / typesafe-utils

A collection of a few small lightweight typesafe utilities.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isObject method

ivanhofer opened this issue · 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