Skip to main content
Latest
variable validateDenoLand
import { validateDenoLand } from "https://deno.land/x/is_valid_package_name@v1.0.0/mod.ts";

Validation for nest.land package name

Examples

Example 1

validateDenoLand('is_valid') // [ true, "" ]
validateDenoLand('is-valid') // [ false, "Name contains only the characters a-z, 0-9 and _" ]

Example 2

// checkAll
validateDenoLand(" 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