add shrink_story to remove empty (including \s chars) sections
				
					
				
			This commit is contained in:
		
							parent
							
								
									55b40d3476
								
							
						
					
					
						commit
						4bcc4a732b
					
				
							
								
								
									
										10
									
								
								coretool.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								coretool.js
									
									
									
									
									
								
							@ -338,4 +338,14 @@ module.exports = {
 | 
				
			|||||||
    else // undefined, NaN, Infinity, {}
 | 
					    else // undefined, NaN, Infinity, {}
 | 
				
			||||||
      return 0
 | 
					      return 0
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  shrink_story (story) {
 | 
				
			||||||
 | 
					    if (Array.isArray(story)) {
 | 
				
			||||||
 | 
					      story = story.filter(section => Object.values(section).some(val => val?.trim?.())) // (section.text || section.image || section.video)?.trim?.()
 | 
				
			||||||
 | 
					      return story
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      story = []
 | 
				
			||||||
 | 
					      return story
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user