is-kit

define

Wrap a predicate to brand it as a guard for composition and inference stability.

import { define, isString } from 'is-kit';
// Prefer generics on define<T> to avoid verbose type predicates
const isNonEmptyString = define<string>(
(value) => isString(value) && value.length > 0
);
isNonEmptyString('foo'); // true
isNonEmptyString(''); // false