@@ -2,6 +2,7 @@ import { computed, Signal, Type } from '@angular/core';
2
2
import { Vector2 , Vector3 , Vector4 } from 'three' ;
3
3
import { NgtVector2 , NgtVector3 , NgtVector4 } from '../three-types' ;
4
4
import { NgtAnyRecord } from '../types' ;
5
+ import { is } from './is' ;
5
6
6
7
type KeysOfType < TObject extends object , TType > = Exclude <
7
8
{
@@ -15,17 +16,20 @@ export function omit<TObject extends object, TKeys extends (keyof TObject)[]>(
15
16
keysToOmit : TKeys ,
16
17
) : Signal < Omit < TObject , TKeys [ number ] > > ;
17
18
export 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 ;
21
23
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
+ }
26
28
27
- return result ;
28
- } ) ;
29
+ return result ;
30
+ } ,
31
+ { equal : ( a , b ) => is . equ ( a , b , { objects : 'shallow' , arrays : 'shallow' } ) } ,
32
+ ) ;
29
33
}
30
34
31
35
export function pick < TObject extends object , TKey extends keyof TObject > (
0 commit comments