Skip to main content
Module

x/registerable/deps.ts>validateNestLand

Check if it can be registered as a package name or domain name
Latest
variable validateNestLand
import { validateNestLand } from "https://deno.land/x/registerable@v1.3.2/deps.ts";

Validation for nest.land package name

Examples

Example 1

validateNestLand('oak') // [ true, "" ]
validateNestLand('o') // [ false, "Name length must be greater than 1" ] * ```

Example 2

// checkAll
validateNestLand(" Abc", true); // [ false, ["Name cannot contain leading or trailing spaces", "Name contains only the characters a-z, 0-9 and _" ]]

type

<T extends boolean = false>(val: unknown, checkAll?: T) => T extends true ? ResultMsgs : ResultMsg