From 3124c34d2b056b596a8f18476f745caef7a64451 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Wed, 31 Aug 2022 17:26:10 +0300 Subject: [PATCH] feat: bump `typescript` to 4.8.2 (#1388) --- package.json | 2 +- src/TypeFormatter/UnionTypeFormatter.ts | 4 +++- yarn.lock | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 783f0fdac..619d521b7 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "json5": "^2.2.1", "normalize-path": "^3.0.0", "safe-stable-stringify": "^2.3.1", - "typescript": "~4.7.4" + "typescript": "~4.8.2" }, "devDependencies": { "@auto-it/conventional-commits": "^10.37.4", diff --git a/src/TypeFormatter/UnionTypeFormatter.ts b/src/TypeFormatter/UnionTypeFormatter.ts index 2e4d1ef22..38350334e 100644 --- a/src/TypeFormatter/UnionTypeFormatter.ts +++ b/src/TypeFormatter/UnionTypeFormatter.ts @@ -56,7 +56,9 @@ export class UnionTypeFormatter implements SubTypeFormatter { // Flatten anyOf inside anyOf unless the anyOf has an annotation for (const def of definitions) { - if (Object.keys(def) === ["anyOf"]) { + const keys = Object.keys(def); + + if (keys.length === 1 && keys[0] === "anyOf") { flattenedDefinitions.push(...(def.anyOf as any)); } else { flattenedDefinitions.push(def); diff --git a/yarn.lock b/yarn.lock index 30edabc2b..6affe66da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5614,10 +5614,10 @@ typescript-memoize@^1.0.0-alpha.3: resolved "https://registry.yarnpkg.com/typescript-memoize/-/typescript-memoize-1.1.0.tgz#4a8f512d06fc995167c703a3592219901db8bc79" integrity sha512-LQPKVXK8QrBBkL/zclE6YgSWn0I8ew5m0Lf+XL00IwMhlotqRLlzHV+BRrljVQIc+NohUAuQP7mg4HQwrx5Xbg== -typescript@~4.7.4: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== +typescript@~4.8.2: + version "4.8.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790" + integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw== typical@^4.0.0: version "4.0.0"