From abb9f0af04d8f67703985873b84af5bf36905a40 Mon Sep 17 00:00:00 2001 From: spinillos Date: Tue, 25 Jul 2023 11:51:00 +0200 Subject: [PATCH] Use default import mapper --- encoding/typescript/gen.go | 6 ++---- encoding/typescript/ts_test.go | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/encoding/typescript/gen.go b/encoding/typescript/gen.go index 429191d..4b5a3d9 100644 --- a/encoding/typescript/gen.go +++ b/encoding/typescript/gen.go @@ -64,10 +64,8 @@ func GenerateTypes(sch thema.Schema, cfg *TypeConfig) (*ast.File, error) { } if cfg.CuetsyConfig == nil { cfg.CuetsyConfig = &cuetsy.Config{ - ImportMapper: func(_ string) (string, error) { - return "", nil - }, - Export: true, + ImportMapper: cuetsy.IgnoreImportMapper, + Export: true, } } if cfg.RootName == "" { diff --git a/encoding/typescript/ts_test.go b/encoding/typescript/ts_test.go index b7acab3..3350782 100644 --- a/encoding/typescript/ts_test.go +++ b/encoding/typescript/ts_test.go @@ -32,7 +32,6 @@ func TestGenerate(t *testing.T) { name: "nilcfg", cfg: nil, }, - {}, } for _, tb := range table {