From c45e4b2e9d0c4f3a41cbf658388364335122826f Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Thu, 9 Jun 2022 19:09:40 -0500 Subject: [PATCH] Use has helper for checking save method --- build-lists.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-lists.js b/build-lists.js index a4af78c..20cd2f2 100644 --- a/build-lists.js +++ b/build-lists.js @@ -5,7 +5,7 @@ import dotenv from 'dotenv' import semver from 'semver' import { PromisePool } from '@supercharge/promise-pool' import memoize from 'fast-memoize' -// import has from 'just-has' +import has from 'just-has' import { saveYouTubeVideos } from '~/helpers/api/youtube/build.js' import buildAppList from '~/helpers/build-app-list.js' @@ -502,8 +502,8 @@ class BuildLists { }) } - const hasSaveMethod = listOptions.hasOwnProperty('beforeSave') const saveMethod = hasSaveMethod ? listOptions.beforeSave : listSet => Array.from( listSet ) + const hasSaveMethod = has( listOptions, 'beforeSave' ) const [ saveableEntry ] = saveMethod( new Set( [ listEntry ] ) )