Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-util-is

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-util-is

TypeScript typeof utility helper with no dependencies.

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3K
increased by9.41%
Maintainers
1
Weekly downloads
 
Created
Source

NPM Version Build Status Dev Dependency Status

ts-util-is

TypeScript typeof utility helper with no dependencies. Provides type guards for all common types.

Installation

npm install ts-util-is

Usage

Import everything:

import * as util from 'ts-util-is';

let value: string | any[] = 'hey there';

if (util.isArray(value)) {
    console.log(value.join(' ')); // no TypeScript error!
}

Import only what you need:

import { isArray, isString } from 'ts-util-is';

let value: string | any[] = 'types are fun';

if (isArray(value)) {
    console.log(value.join(' ')); // no TypeScript error!
}

Methods

  • isArray()
  • isBase64()
  • isBoolean()
  • isDate()
  • isDateValid()
  • isDefined()
  • isError()
  • isFunction()
  • isGuid()
  • isInfinity()
  • isNull()
  • isNumber()
  • isObject()
  • isPlainObject()
  • isRegExp()
  • isString()
  • isSymbol()
  • isUndefined()

Keywords

FAQs

Package last updated on 18 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc