File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,12 +6,12 @@ import { isObject } from './helpers';
66 * an object's entries (key-value pairs).
77 */
88// tslint:disable-next-line: variable-name
9- const DeepCompositeSymbol = ( ( object : any , filter ?: ( entry : [ string , any ] ) => boolean ) => {
9+ const DeepCompositeSymbol = ( object : any , filter ?: ( entry : [ string , any ] ) => boolean ) => {
1010 const entries = filter ? Object . entries ( object ) . filter ( filter ) : Object . entries ( object ) ;
1111 // Recursively replace non-tuple object values with tuples
12- entries . forEach ( x => update ( x , filter ) ) ;
12+ entries . forEach ( entry => update ( entry , filter ) ) ;
1313 return Tuple . unsafeSymbol ( ...flatten ( entries ) ) ;
14- } ) as any ;
14+ } ;
1515
1616const update = ( entry : any , filter ?: any ) => {
1717 const v = entry [ 1 ] ;
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ import DeepCompositeSymbol from './DeepCompositeSymbol';
55 * https://github.com/tc39/proposal-record-tuple
66 */
77// tslint:disable-next-line: variable-name
8- const ValueObject = < A extends object > ( object : A , keyFilter ?: ( key : string ) => boolean ) : A => {
9- const key = DeepCompositeSymbol ( object , keyFilter ) ;
8+ const ValueObject = < A extends object > (
9+ object : A ,
10+ filter ?: ( entry : [ string , any ] ) => boolean ,
11+ ) : A => {
12+ const key = DeepCompositeSymbol ( object , filter ) ;
1013 if ( cache . has ( key ) ) {
1114 return cache . get ( key ) as A ;
1215 }
You can’t perform that action at this time.
0 commit comments