From 8923194e39c6827a193139e8623f0af1dc56060b Mon Sep 17 00:00:00 2001 From: Simon Lecoq <22963968+lowlighter@users.noreply.github.com> Date: Mon, 1 Jul 2024 21:36:42 +0200 Subject: [PATCH] feat(typing): add `RecordValue` --- typing/types.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/typing/types.ts b/typing/types.ts index c3368939..5646b290 100644 --- a/typing/types.ts +++ b/typing/types.ts @@ -9,6 +9,9 @@ export type callback = Function /** Record. */ export type record = Record +/** Extract value type from Record. */ +export type RecordValue = T extends Record ? U : never + /** Extract key type from {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map | Map}. */ export type MapKey = T extends Map ? U : never