It Should Help

VerifierFactory Reference

should() returns the VerifierFactory singleton — the only entry point of the library.

import { should } from '@artstesh/it-should'; should().number(5).positive();

Factory methods

Method

Examined value

Returns

array<T>(entry: (T \| null \| undefined)[] \| null \| undefined)

an array

ArrayVerifier<T>

number(entry: number \| null \| undefined)

a number

NumberVerifier

string(entry: string \| null \| undefined)

a string

StringVerifier

date(entry: Date \| string \| null \| undefined)

a date or ISO string

DateVerifier

objects<T extends {}, P extends {}>(entry: T, other: P)

two objects

ObjectsVerifier<T, P>

Boolean-context checks

Method

Passes when

Failure message

true(entry: any): void

entry is truthy — not false, 0, '', null, undefined, NaN

The entry expected to be true.

false(entry: any): void

entry is falsy

The entry expected to be false.

Both are terminal: they return void and have no not form. See General Assertions.

Shared verifier members

Every verifier returned above inherits:

Member

Behavior

not (property)

inverts every following check in the chain

defined()

passes when the entry is not null/undefined; otherwise throws The entry is not defined.

The rules for null/undefined entries under not are documented in Concepts.

Verifier pages

Number· String· Date· Array· Objects

02 сентября 2026