From 7407ac47a26cb6f03a5346e55aaf0e83b8a6dd5b Mon Sep 17 00:00:00 2001 From: Luk Date: Wed, 1 May 2024 13:56:00 +0800 Subject: [PATCH] rename `shrink_story` to `filter_story` because it cannot change the original story --- coretool.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/coretool.js b/coretool.js index 9bab6d7..5b79cc3 100644 --- a/coretool.js +++ b/coretool.js @@ -339,13 +339,11 @@ module.exports = { return 0 }, - shrink_story (story) { + filter_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 + return story.filter(section => Object.values(section).some(val => val?.trim?.())) // (section.text || section.image || section.video)?.trim?.() } else { - story = [] - return story + return [] } } }