|
1 | | -import { uniq } from "lodash-es" |
2 | 1 | import { test } from "uvu" |
3 | 2 | import { equal } from "uvu/assert" |
4 | 3 | import { filterEmpty, filterNullable, isUniq } from "../src/main" |
@@ -44,25 +43,6 @@ test("filterEmpty", () => { |
44 | 43 | equal(filterEmpty([1, undefined, "c"]), [1, "c"]) |
45 | 44 | }) |
46 | 45 |
|
47 | | -test("uniq", () => { |
48 | | - equal(uniq([1, 2, 3]), [1, 2, 3]) |
49 | | - equal(uniq([1, 2, 1]), [1, 2]) |
50 | | - equal(uniq(["a", "b", "c"]), ["a", "b", "c"]) |
51 | | - equal(uniq(["a", "b", "a"]), ["a", "b"]) |
52 | | - equal(uniq([1, "b", 3]), [1, "b", 3]) |
53 | | - equal(uniq([1, "b", 1]), [1, "b"]) |
54 | | - equal(uniq([]), []) |
55 | | - equal(uniq([null]), [null]) |
56 | | - equal(uniq([undefined]), [undefined]) |
57 | | - equal(uniq([null, undefined]), [null, undefined]) |
58 | | - equal(uniq([1, true]), [1, true]) |
59 | | - equal(uniq([true, true]), [true]) |
60 | | - |
61 | | - const a = { a: 1 } |
62 | | - equal(uniq([a, { b: 2 }]), [a, { b: 2 }]) |
63 | | - equal(uniq([a, a]), [a]) |
64 | | -}) |
65 | | - |
66 | 46 | test("isUniq", () => { |
67 | 47 | equal(isUniq([1, 2, 3]), true) |
68 | 48 | equal(isUniq([1, 2, 1]), false) |
|
0 commit comments