From 6d97f6db5fd3e8ff6a244ceac7ac8c6b3065db52 Mon Sep 17 00:00:00 2001 From: krulod Date: Thu, 19 Oct 2023 00:54:25 +0300 Subject: [PATCH] fix(lens): dont allow non-recs as match.with input --- packages/lens/src/match.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/packages/lens/src/match.ts b/packages/lens/src/match.ts index 2f80907a4..771a43300 100644 --- a/packages/lens/src/match.ts +++ b/packages/lens/src/match.ts @@ -8,32 +8,21 @@ import { isAtom, throwReatomError, } from '@reatom/core' -import { isDeepEqual, isRec, isShallowEqual, merge } from '@reatom/utils' +import { isRec, isShallowEqual, merge } from '@reatom/utils' type Primitive = null | undefined | string | number | boolean | symbol | bigint export type BuiltIns = Primitive | Date | RegExp export type PartialDeep = T extends BuiltIns - ? T | undefined - : T extends Map - ? {} & Map, PartialDeep> - : T extends Set - ? {} & Set> - : T extends ReadonlyMap - ? {} & ReadonlyMap, PartialDeep> - : T extends ReadonlySet - ? PartialDeepSetReadonly - : T extends (...arguments_: any[]) => unknown ? T | undefined : T extends object ? T extends ReadonlyArray - ? T + ? never : { [K in keyof T]?: PartialDeep } : unknown -type PartialDeepSetReadonly = {} & ReadonlySet> interface Match extends Atom {