Skip to main content
Module

x/abstruct/deps.ts>isEmpty

Abstract structure for JavaScript data validation
Go to Latest
function isEmpty
import { isEmpty } from "https://deno.land/x/abstruct@1.0.0-beta.7/deps.ts";

Weather the string is empty or not.

Examples

Example 1

import { isEmpty } from "https://deno.land/x/isx@$VERSION/iterable/is_empty.ts";
import { assert, assertFalse } from "https://deno.land/std/testing/asserts.ts";

assert(isEmpty(""));
assertFalse(isEmpty("a"));

Parameters

input: string

Any string.

Returns

input is ""

Weather the array is empty or not.

Examples

Example 1

import { isEmpty } from "https://deno.land/x/isx@$VERSION/iterable/is_empty.ts";
import { assert, assertFalse } from "https://deno.land/std/testing/asserts.ts";

assert(isEmpty([]));
assertFalse(isEmpty([""]));

Parameters

input: unknown[]

Any array.

Returns

input is []

Parameters

input: readonly unknown[]

Returns

input is readonly []

Wether the input is empty or not.

Examples

Example 1

import { isEmpty } from "https://deno.land/x/isx@$VERSION/iterable/is_empty.ts";
import { assert, assertFalse } from "https://deno.land/std/testing/asserts.ts";

assert(isEmpty(new Set()));
assertFalse(isEmpty(new Set("")));

Parameters

input: Iterable<unknown>

Any iterable.

Returns

boolean