-
Notifications
You must be signed in to change notification settings - Fork 0
guards.Function.aryGuard
github-actions[bot] edited this page Jun 8, 2026
·
2 revisions
@zenstone/ts-utils / guards / aryGuard
aryGuard<
T>(guard):TypeGuard<T[]>
Defined in: src/guards/index.ts:411
柯里化的数组类型守卫
T
(item) => item is T
元素类型守卫
TypeGuard<T[]>
数组类型守卫函数
const isStrAry = aryGuard(isStr);
if (isStrAry(value)) {
// value is string[]
}
// 配合 and 使用
const isNonEmptyStrAry = and(isStrAry, (arr) => arr.length > 0);