Skip to main content
Module

x/abstruct/deps.ts>isNotEmpty

Abstract structure for JavaScript data validation
Latest
function isNotEmpty
import { isNotEmpty } from "https://deno.land/x/abstruct@1.0.0/deps.ts";

Whether the array is not empty or not.

Examples

Example 1

import { isNotEmpty } from "https://deno.land/x/isx@$VERSION/iterable/is_not_empty.ts";
import { assert } from "https://deno.land/std/testing/asserts.ts";

assert(isNotEmpty([""]));
assert(isNotEmpty([[]]));

Parameters

input: T[]

Any array.

Returns

input is [T, ...T[]]

Parameters

input: readonly T[]

Returns

input is readonly [T, ...T[]]

Whether the input is not empty or not.

Examples

Example 1

import { isNotEmpty } from "https://deno.land/x/isx@$VERSION/iterable/is_not_empty.ts";
import { assert } from "https://deno.land/std/testing/asserts.ts";

assert(isNotEmpty("abc"));
assert(isNotEmpty([new Set([0, 1, 2])]));

Parameters

input: Iterable<unknown>

Any iterable.

Returns

boolean