@@ -230,7 +230,7 @@ const defaultMethods = {
230
230
[ Sync ] : ( data , buildState ) => isSyncDeep ( data , buildState . engine , buildState ) ,
231
231
method : ( arr , context , above , engine ) => {
232
232
if ( ! Array . isArray ( arr ) ) throw INVALID_ARGUMENTS
233
- if ( ! arr . length ) return false
233
+ if ( ! arr . length ) return null
234
234
235
235
let item
236
236
for ( let i = 0 ; i < arr . length ; i ++ ) {
@@ -242,7 +242,7 @@ const defaultMethods = {
242
242
} ,
243
243
asyncMethod : async ( arr , _1 , _2 , engine ) => {
244
244
if ( ! Array . isArray ( arr ) ) throw INVALID_ARGUMENTS
245
- if ( ! arr . length ) return false
245
+ if ( ! arr . length ) return null
246
246
247
247
let item
248
248
for ( let i = 0 ; i < arr . length ; i ++ ) {
@@ -256,7 +256,7 @@ const defaultMethods = {
256
256
compile : ( data , buildState ) => {
257
257
let res = buildState . compile ``
258
258
if ( Array . isArray ( data ) ) {
259
- if ( ! data . length ) return buildState . compile `false `
259
+ if ( ! data . length ) return buildState . compile `null `
260
260
for ( let i = 0 ; i < data . length ; i ++ ) res = buildState . compile `${ res } engine.truthy(prev = ${ data [ i ] } ) ? prev : `
261
261
res = buildState . compile `${ res } prev`
262
262
return res
@@ -388,7 +388,7 @@ const defaultMethods = {
388
388
[ Sync ] : ( data , buildState ) => isSyncDeep ( data , buildState . engine , buildState ) ,
389
389
method : ( arr , context , above , engine ) => {
390
390
if ( ! Array . isArray ( arr ) ) throw INVALID_ARGUMENTS
391
- if ( ! arr . length ) return false
391
+ if ( ! arr . length ) return null
392
392
393
393
let item
394
394
for ( let i = 0 ; i < arr . length ; i ++ ) {
@@ -399,7 +399,7 @@ const defaultMethods = {
399
399
} ,
400
400
asyncMethod : async ( arr , _1 , _2 , engine ) => {
401
401
if ( ! Array . isArray ( arr ) ) throw INVALID_ARGUMENTS
402
- if ( ! arr . length ) return false
402
+ if ( ! arr . length ) return null
403
403
let item
404
404
for ( let i = 0 ; i < arr . length ; i ++ ) {
405
405
item = await engine . run ( arr [ i ] , _1 , { above : _2 } )
@@ -412,7 +412,7 @@ const defaultMethods = {
412
412
compile : ( data , buildState ) => {
413
413
let res = buildState . compile ``
414
414
if ( Array . isArray ( data ) ) {
415
- if ( ! data . length ) return buildState . compile `false `
415
+ if ( ! data . length ) return buildState . compile `null `
416
416
for ( let i = 0 ; i < data . length ; i ++ ) res = buildState . compile `${ res } !engine.truthy(prev = ${ data [ i ] } ) ? prev : `
417
417
res = buildState . compile `${ res } prev`
418
418
return res
0 commit comments