mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Add generics to typescript generator (#4664)
* feat: Support generating generics in interfaces * Switch struct to a template * Support generics in apitypings
This commit is contained in:
@@ -9,6 +9,22 @@ import (
|
||||
"github.com/coder/coder/coderd/util/slice"
|
||||
)
|
||||
|
||||
func TestUnique(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
require.ElementsMatch(t,
|
||||
[]int{1, 2, 3, 4, 5},
|
||||
slice.Unique([]int{
|
||||
1, 2, 3, 4, 5, 1, 2, 3, 4, 5,
|
||||
}))
|
||||
|
||||
require.ElementsMatch(t,
|
||||
[]string{"a"},
|
||||
slice.Unique([]string{
|
||||
"a", "a", "a",
|
||||
}))
|
||||
}
|
||||
|
||||
func TestContains(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user