New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@js-utilities/typecheck

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@js-utilities/typecheck

Utility library for javascript type checking.

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Type checking library

npm version Build Status

A set of super-simple type checkers. Each checker returns boolean value. Most checkers are typescript type predicates.

Installation

npm i -S @js-utilities/typecheck

Usage example

import { isCallable } from "@js-utilities/typecheck";

const a: unknown = global.value;

if (isCallable(a)) a();

Available checkers:

CheckerReturn type
isCallableboolean
isFunctionvalue is Function
isArrowFunctionboolean
isArray<T>value is T[]
isObject<T>value is T
isBooleanvalue is boolean
isUndefinedvalue is undefined
isNumbervalue is number
isStringvalue is string
isSymbolvalue is symbol
isNullvalue is null
isMap<T, U>value is Map<T, U>
isSet<T>value is Set<T>
isWeakSet<T>value is WeakSet<T>
isWeakMap<T, U>value is WeakMap<T, U>
isPromise<T>value is Promise<T>

License

MIT License

Keywords

FAQs

Package last updated on 07 Nov 2021

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