assertArrayNotEmpty
assertArrayNotEmpty
Section titled “assertArrayNotEmpty”Assert that an array has at least one element, with type-narrowing.
import { assertArrayNotEmpty } from "@kensio/smartass";
const value: unknown = ["admin"];
assertArrayNotEmpty(value);
// value is now narrowed to a non-empty arraySource
Section titled “Source”Source file: src/assert/array-not-empty/array-not-empty.assert.ts
