@metaplex-foundation/umi-options
Advanced tools
Comparing version 0.8.2 to 0.8.5
@@ -12,3 +12,3 @@ import { None, Some } from './common'; | ||
*/ | ||
type UnwrappedOption<T, U = null> = T extends Some<infer TValue> ? UnwrappedOption<TValue, U> : T extends None ? U : T extends object ? { | ||
export type UnwrappedOption<T, U = null> = T extends Some<infer TValue> ? UnwrappedOption<TValue, U> : T extends None ? U : T extends string | number | boolean | symbol | bigint | undefined | null | Uint8Array | Date ? T : T extends object ? { | ||
[key in keyof T]: UnwrappedOption<T[key], U>; | ||
@@ -28,2 +28,1 @@ } : T extends Array<infer TItem> ? Array<UnwrappedOption<TItem, U>> : T; | ||
export declare function unwrapOptionRecursively<T, U>(input: T, fallback: () => U): UnwrappedOption<T, U>; | ||
export {}; |
{ | ||
"name": "@metaplex-foundation/umi-options", | ||
"version": "0.8.2", | ||
"version": "0.8.5", | ||
"description": "A TypeScript implementation of Rust Options", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -13,6 +13,17 @@ import { None, Some, isOption, isSome } from './common'; | ||
*/ | ||
type UnwrappedOption<T, U = null> = T extends Some<infer TValue> | ||
export type UnwrappedOption<T, U = null> = T extends Some<infer TValue> | ||
? UnwrappedOption<TValue, U> | ||
: T extends None | ||
? U | ||
: T extends | ||
| string | ||
| number | ||
| boolean | ||
| symbol | ||
| bigint | ||
| undefined | ||
| null | ||
| Uint8Array | ||
| Date | ||
? T | ||
: T extends object | ||
@@ -19,0 +30,0 @@ ? { [key in keyof T]: UnwrappedOption<T[key], U> } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40569
631