File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export type Condition = (
5050) => boolean ;
5151
5252export type Fn = (
53- event : WalkerOS . PartialEvent ,
53+ value : WalkerOS . DeepPartialEvent | unknown ,
5454 mapping : Value ,
5555 options : Options ,
5656) => WalkerOS . Property | unknown ;
Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ function processMappingValue(
7979 return mappings . reduce ( ( acc , mappingItem ) => {
8080 if ( acc ) return acc ; // A valid result was already found
8181
82+ const mapping = isString ( mappingItem ) ? { key : mappingItem } : mappingItem ;
83+
8284 const {
8385 condition,
8486 consent,
@@ -89,7 +91,7 @@ function processMappingValue(
8991 set,
9092 validate,
9193 value : staticValue ,
92- } = isString ( mappingItem ) ? { key : mappingItem } : mappingItem ;
94+ } = mapping ;
9395
9496 // Check if this mapping should be used
9597 if ( condition && ! condition ( value , mappingItem , instance ) ) return ;
@@ -102,7 +104,7 @@ function processMappingValue(
102104
103105 if ( fn ) {
104106 // Use a custom function to get the value
105- mappingValue = fn ( value as WalkerOS . PartialEvent , mappingItem , options ) ; // @TODO stop casting
107+ mappingValue = fn ( value , mappingItem , options ) ;
106108 }
107109
108110 if ( key ) {
You can’t perform that action at this time.
0 commit comments