From 4eecb937d7f0d1dc100b488d77731e7161047fc7 Mon Sep 17 00:00:00 2001 From: Mohammad Hasani Date: Mon, 27 May 2019 18:57:51 +0430 Subject: [PATCH] fix: nested DeepImmutable and Immutable types neutralization closes #65 --- src/types.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/types.ts b/src/types.ts index 22d50bd..d224a90 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,6 +17,10 @@ export type Immutable = T extends Primitive ? ReadonlyArray : T extends Map ? ReadonlyMap + : T extends ReadonlyArray + ? T + : T extends ReadonlyMap + ? T : Readonly export type DeepImmutable = T extends Primitive @@ -25,6 +29,10 @@ export type DeepImmutable = T extends Primitive ? DeepImmutableArray : T extends Map ? DeepImmutableMap + : T extends ReadonlyArray + ? DeepImmutableArray + : T extends ReadonlyMap + ? DeepImmutableMap : DeepImmutableObject export type Reducer = (