From 9be74612bb3d645791510131914cb958ee9a560c Mon Sep 17 00:00:00 2001 From: otakuto Date: Mon, 29 May 2023 07:22:50 +0900 Subject: [PATCH] Add intoOneof --- packages/runtime/src/oneof.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/runtime/src/oneof.ts b/packages/runtime/src/oneof.ts index 87feebcf..ae29d333 100644 --- a/packages/runtime/src/oneof.ts +++ b/packages/runtime/src/oneof.ts @@ -158,3 +158,11 @@ export function getSelectedOneofValue (x: U): U & { oneofKind: keyof U} { + return { + ...x, + oneofKind: Object.keys(x)[0] + } +} + +