@flighter/type
v1.0.0
Published
One more library for defining types
Downloads
4
Maintainers
Readme
Type
About
One more library for defining types. The library is exported as a non-minified ESM. It also has a rollback UMD version.
Install
npm i @flighter/type -d
Or
yarn add @flighter/type
Download
Initialization
// ESM
import * as Type from '@flighter/type';
import {<function name>} from '@flighter/type';// recommended
import {<function name>} from '@flighter/type/esm/index.js';
import {<function name>} from '@flighter/type/esm/<function name>.js';
// UMD
const Type = require('@flighter/type/umd/index.cjs');
const {<function name>} = require('@flighter/type/umd/index.cjs');
const {<function name>} = require('@flighter/type/umd/<function name>.cjs');
API
- getType(val: unknown): string
- getStrictType(val: unknown): string
- isUndefined(val: unknown, flags?: FlagsType): boolean
- isNull(val: unknown, flags?: FlagsType): boolean
- isNan(val: unknown, flags?: FlagsType): boolean
- isString(val: unknown, flags?: FlagsType): boolean
- isNumber(val: unknown, flags?: FlagsType, emptyStringIsNumber?: boolean = false): boolean
- isBoolean(val: unknown, flags?: FlagsType): boolean
- isSymbol(val: unknown): boolean
- isBigInt(val: unknown, flags?: FlagsType): boolean
- isFunction(val: unknown): boolean
- isObject(val: unknown): boolean
- isPlainObject(val: unknown): boolean
- isArray(val: unknown): boolean
- isDate(val: unknown): boolean
- isRegExp(val: unknown): boolean
- isMap(val: unknown): boolean
- isSet(val: unknown): boolean
- isWeakMap(val: unknown): boolean
- isWeakSet(val: unknown): boolean