@@ -2,6 +2,7 @@ import { computed, Signal, Type } from '@angular/core';
22import { Vector2 , Vector3 , Vector4 } from 'three' ;
33import { NgtVector2 , NgtVector3 , NgtVector4 } from '../three-types' ;
44import { NgtAnyRecord } from '../types' ;
5+ import { is } from './is' ;
56
67type KeysOfType < TObject extends object , TType > = Exclude <
78 {
@@ -15,17 +16,20 @@ export function omit<TObject extends object, TKeys extends (keyof TObject)[]>(
1516 keysToOmit : TKeys ,
1617) : Signal < Omit < TObject , TKeys [ number ] > > ;
1718export function omit ( objFn : ( ) => NgtAnyRecord , keysToOmit : string [ ] ) {
18- return computed ( ( ) => {
19- const obj = objFn ( ) ;
20- const result = { } as NgtAnyRecord ;
19+ return computed (
20+ ( ) => {
21+ const obj = objFn ( ) ;
22+ const result = { } as NgtAnyRecord ;
2123
22- for ( const key of Object . keys ( obj ) ) {
23- if ( keysToOmit . includes ( key ) ) continue ;
24- Object . assign ( result , { [ key ] : obj [ key ] } ) ;
25- }
24+ for ( const key of Object . keys ( obj ) ) {
25+ if ( keysToOmit . includes ( key ) ) continue ;
26+ Object . assign ( result , { [ key ] : obj [ key ] } ) ;
27+ }
2628
27- return result ;
28- } ) ;
29+ return result ;
30+ } ,
31+ { equal : ( a , b ) => is . equ ( a , b , { objects : 'shallow' , arrays : 'shallow' } ) } ,
32+ ) ;
2933}
3034
3135export function pick < TObject extends object , TKey extends keyof TObject > (
0 commit comments