Functions for testing the types of JavaScript values, cross-realm. Has testers for all standard built-in objects/values.

Overview

@suchipi/is

Functions for testing the types of JavaScript values, cross-realm. Has testers for all standard built-in objects/values.

Usage

import { is } from "@suchipi/is";

console.log(is.Object({})); // true
console.log(is.Array([])); // true
console.log(is.String(null)); // false

// etc

Available functions

  • String
  • string (alias of String)
  • Number (does not return true for NaN)
  • number (alias of Number)
  • Boolean
  • boolean (alias of Boolean)
  • BigInt
  • bigint (alias of BigInt)
  • Symbol
  • symbol (alias of Symbol)
  • null
  • undefined
  • void
  • Object (does not return true for null)
  • object (alias of Object)
  • Array
  • Function
  • function (alias of Function)
  • tagged (Object toString tag checker)
  • instanceOf (same as instanceof)
  • Error (matches Error subclasses, too)
  • Infinity
  • NegativeInfinity
  • NaN
  • Date
  • RegExp
  • Map
  • Set
  • WeakMap
  • WeakSet
  • ArrayBuffer
  • SharedArrayBuffer
  • DataView
  • TypedArray
  • Int8Array
  • Uint8Array
  • Uint8ClampedArray
  • Int16Array
  • Uint16Array
  • Int32Array
  • Uint32Array
  • Float32Array
  • Float64Array
  • Promise (matches any thenable)
  • Generator (only guaranteed to match generators that weren't compiled with Babel or etc)
  • GeneratorFunction (only guaranteed to match generator functions that weren't compiled with Babel or etc)
  • AsyncFunction (only guaranteed to match async functions that weren't compiled with Babel or etc)
  • AsyncGenerator (only guaranteed to match async generators that weren't compiled with Babel or etc)
  • AsyncGeneratorFunction (only guaranteed to match async generator functions that weren't compiled with Babel or etc)

Notes

Two utility types, TypedArray and TypedArrayConstructor, are also exported from this package.

License

MIT

You might also like...

AdsPower supports Local API, which has functions like reading and writing account configuration information, opening and closing browsers, searching for accounts.

AdsPower supports Local API, which has functions like reading and writing account configuration information, opening and closing browsers, searching for accounts. Besides, it can cooperate with Selenium and Puppeteer to execute browser operations automatically.

Dec 1, 2022

Modern Cross Browser Testing in JavaScript using Playwright

 Modern Cross Browser Testing in JavaScript using Playwright

Modern Cross Browser Testing in JavaScript using Playwright This repository contains the example code for the Modern Cross Browser Testing in JavaScri

Oct 3, 2022

Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes Introduction Salesforce Functions lets you use the Salesforce Platform for building event-driven, elastically scalable apps and expe

Dec 29, 2022

Fullstack Dynamic NFT Mini Game built using 💎 Diamond Standard [EIP 2535] 🏃‍♀️Players can use Hero NFT to battle against Thanos ⚔ Heroes can be Healed by staking their NFT 🛡

Fullstack Dynamic NFT Mini Game built using 💎 Diamond Standard [EIP 2535]  🏃‍♀️Players can use Hero NFT to battle against Thanos ⚔ Heroes can be Healed by staking their NFT 🛡

💎 Fullstack Dynamic NFT Mini Game 🎮 💎 Using Diamond Standard Play On 💎 🎮 ⏩ http://diamond-dapp.vercel.app/ Project Description 📝 Fullstack Dynam

Dec 23, 2022

AREX: It is a “Differential Testing” and “Record and Replay Testing” Tool.

AREX: It is a “Differential Testing” and “Record and Replay Testing” Tool. Test restful API by record, replay and stub request/response. Differential

Nov 1, 2022

Tiny and fast utility to extract all possible values for a given enum.

Tiny (208B) and fast utility to extract all possible values for a given enum.

Apr 18, 2022

✨ Standard library for JavaScript and Node.js. ✨

✨ Standard library for JavaScript and Node.js. ✨

stdlib (/ˈstændərd lɪb/ "standard lib") is a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing appli

Dec 31, 2022

A javascript standard data structure library which benchmark against C++ STL.

js-sdsl A javascript standard data structure library which benchmark against C++ STL. Note Note that our official version starts from 2.0.0. In order

Dec 10, 2022
Owner
Lily Skye
Former Prettier Core Maintainer, Former Babel team member. Interested in JavaScript, TypeScript, Rust, Unity, VR, Dev Tooling, Dev Experience, React, and more.
Lily Skye
🧩 TypeScript utility type in order to ensure to return only properties (not methods) containing values in primitive types such as number or boolean (not Value Objects)

?? TypeScript Primitives type TypeScript utility type in order to ensure to return only properties (not methods) containing values in primitive types

CodelyTV 82 Dec 7, 2022
Compile-time tests for types. Useful to make sure types don't regress into being overly-permissive as changes go in over time.

expect-type Compile-time tests for types. Useful to make sure types don't regress into being overly-permissive as changes go in over time. Similar to

Misha Kaletsky 82 Jan 8, 2023
A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Prisma ORM. Deploys to Fly.io

Live Demo · Twitter A testing focused Remix Stack, that integrates E2E & Unit testing with Playwright, Vitest, MSW and Testing Library. Driven by Pris

Remix Stacks 18 Oct 31, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Functions and objects that make it easier to add fields to Portable Text editors for accessibility meta information, like language changes or abbreviations.

Porta11y Porta11y is a collection of accessibility-focused annotations, decorators and validators for Sanity’s Portable Text editor. Portable Text is

Hidde de Vries 21 Aug 25, 2022
🚀 Transition number values using easing functions

react-transition-value Transition / Animate number values using easing functions See Demos ⚡️ Getting started npm i react-transition-value import {

Björn 46 Dec 15, 2022
Automated testing for single-page applications (SPAs). Small, portable, and easy to use. Click on things, fill in values, await for things exist, etc.

SPA Check Automated testing for single-page applications (SPAs). Small, portable, and easy to use. Click on things, fill in values, await for things e

Cory Leigh Rahman 5 Dec 23, 2022
Javascript-testing-practical-approach-2021-course-v3 - Javascript Testing, a Practical Approach (v3)

Javascript Testing, a Practical Approach Description This is the reference repository with all the contents and the examples of the "Javascript Testin

Stefano Magni 2 Nov 14, 2022