Skip to main content
Module

x/is_valid_package_name/deps.ts>uniq

Validation for package name
Latest
variable uniq
import { uniq } from "https://deno.land/x/is_valid_package_name@v1.0.0/deps.ts";

Returns a new Array containing only one copy of each element in the original array. equal is used to determine equality.

Examples

Example 1

uniq([1, 2, 1, 1]) // [1, 2]
uniq([{}, {}, [], []]) // [{}, []]
uniq([[1, 2, 3], [1, 2, 3]]) // [[1, 2, 3]]

type

<T extends unknown>(val: readonly T[]) => T[]