From 02e974069ff209bbf91471d134c7c6802c1d69e9 Mon Sep 17 00:00:00 2001 From: Satoshi Date: Wed, 19 Jun 2024 15:22:42 +0900 Subject: [PATCH] refactor --- .changeset/quick-hotels-rule.md | 5 +++++ src/index.ts | 15 ++++----------- 2 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 .changeset/quick-hotels-rule.md diff --git a/.changeset/quick-hotels-rule.md b/.changeset/quick-hotels-rule.md new file mode 100644 index 0000000..9c69f33 --- /dev/null +++ b/.changeset/quick-hotels-rule.md @@ -0,0 +1,5 @@ +--- +'pb-option-builder': patch +--- + +refactor diff --git a/src/index.ts b/src/index.ts index 5965ef8..a1979b3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,18 +47,11 @@ type Expand< }[keyof U] > : never - expand?: NonNullable extends Array + expand?: NonNullable extends + | Array + | (infer U extends TSchema[keyof TSchema]) ? Array>> - : NonNullable extends infer U extends TSchema[keyof TSchema] - ? Array>> - : never - - // Build fails with this simpler syntax due to a bug in esbuild (fixed in v0.19.12 but dependency is not updated yet in tsup and vitest) - // expand?: NonNullable extends - // | Array - // | infer U extends TSchema[keyof TSchema] - // ? Array>> - // : never + : never } }[TKey]