@@ -95,7 +95,7 @@ const defaultMethods = {
95
95
method : ( input , context , above , engine ) => {
96
96
if ( ! Array . isArray ( input ) ) throw new InvalidControlInput ( input )
97
97
98
- if ( input . length === 1 ) return ( engine . fallback || engine ) . run ( input [ 0 ] , context , { above } )
98
+ if ( input . length === 1 ) return engine . run ( input [ 0 ] , context , { above } )
99
99
if ( input . length < 2 ) return null
100
100
101
101
input = [ ...input ]
@@ -109,13 +109,13 @@ const defaultMethods = {
109
109
const check = input . shift ( )
110
110
const onTrue = input . shift ( )
111
111
112
- const test = ( engine . fallback || engine ) . run ( check , context , { above } )
112
+ const test = engine . run ( check , context , { above } )
113
113
114
114
// if the condition is true, run the true branch
115
- if ( engine . truthy ( test ) ) return ( engine . fallback || engine ) . run ( onTrue , context , { above } )
115
+ if ( engine . truthy ( test ) ) return engine . run ( onTrue , context , { above } )
116
116
}
117
117
118
- return ( engine . fallback || engine ) . run ( onFalse , context , { above } )
118
+ return engine . run ( onFalse , context , { above } )
119
119
} ,
120
120
[ Sync ] : ( data , buildState ) => isSyncDeep ( data , buildState . engine , buildState ) ,
121
121
deterministic : ( data , buildState ) => {
@@ -330,15 +330,15 @@ const defaultMethods = {
330
330
method : ( input , context , above , engine ) => {
331
331
if ( ! Array . isArray ( input ) ) throw new InvalidControlInput ( input )
332
332
let [ selector , mapper , defaultValue ] = input
333
- defaultValue = ( engine . fallback || engine ) . run ( defaultValue , context , {
333
+ defaultValue = engine . run ( defaultValue , context , {
334
334
above
335
335
} )
336
336
selector =
337
- ( engine . fallback || engine ) . run ( selector , context , {
337
+ engine . run ( selector , context , {
338
338
above
339
339
} ) || [ ]
340
340
const func = ( accumulator , current ) => {
341
- return ( engine . fallback || engine ) . run (
341
+ return engine . run (
342
342
mapper ,
343
343
{
344
344
accumulator,
@@ -398,8 +398,8 @@ const defaultMethods = {
398
398
[ Sync ] : ( data , buildState ) => isSyncDeep ( data , buildState . engine , buildState ) ,
399
399
method : ( args , context , above , engine ) => {
400
400
if ( ! Array . isArray ( args ) ) throw new Error ( 'Data for pipe must be an array' )
401
- let answer = ( engine . fallback || engine ) . run ( args [ 0 ] , context , { above : [ args , context , ...above ] } )
402
- for ( let i = 1 ; i < args . length ; i ++ ) answer = ( engine . fallback || engine ) . run ( args [ i ] , answer , { above : [ args , context , ...above ] } )
401
+ let answer = engine . run ( args [ 0 ] , context , { above : [ args , context , ...above ] } )
402
+ for ( let i = 1 ; i < args . length ; i ++ ) answer = engine . run ( args [ i ] , answer , { above : [ args , context , ...above ] } )
403
403
return answer
404
404
} ,
405
405
asyncMethod : async ( args , context , above , engine ) => {
@@ -428,7 +428,7 @@ const defaultMethods = {
428
428
const item = object [ key ]
429
429
Object . defineProperty ( accumulator , key , {
430
430
enumerable : true ,
431
- value : ( engine . fallback || engine ) . run ( item , context , { above } )
431
+ value : engine . run ( item , context , { above } )
432
432
} )
433
433
return accumulator
434
434
} , { } )
@@ -493,12 +493,12 @@ function createArrayIterativeMethod (name, useTruthy = false) {
493
493
if ( ! Array . isArray ( input ) ) throw new InvalidControlInput ( input )
494
494
let [ selector , mapper ] = input
495
495
selector =
496
- ( engine . fallback || engine ) . run ( selector , context , {
496
+ engine . run ( selector , context , {
497
497
above
498
498
} ) || [ ]
499
499
500
500
return selector [ name ] ( ( i , index ) => {
501
- const result = ( engine . fallback || engine ) . run ( mapper , i , {
501
+ const result = engine . run ( mapper , i , {
502
502
above : [ { item : selector , index } , context , ...above ]
503
503
} )
504
504
return useTruthy ? engine . truthy ( result ) : result
0 commit comments