A modern utility library for ECMAScript type detection โ built to be safe, testable, and extensible โ zero dependencies, fully inspectable.
npm install @petsel/es-type-detection
import { base, fn, flow, utility } from '@petsel/es-type-detection';
const { isFunction, isObject, isBoxedNumber, isNumberValue, isNumber } = base;
const { isConstructable, isClass, isGeneratorFunction, isNonAsyncArrow } = fn;
const { isAsyncGenerator, isPromise, doesMatchSafeThenable } = flow;
const { resolveType } = utility;
console.log(isClass(class X {})); // true
console.log(isFunction((_) => _)); // true
console.log(resolveType([])); // "Array"
This project is licensed under the MIT License.
MIT ยฉ Peter Seliger
See LICENSE for details.
Please read the TRADEMARK.md for rules regarding project name use, compatibility requirements, and monetization restrictions.
git clone git@github.com:petsel/es-type-detection.git
npm ci
dev.