From 18e249eb2559f62239f630e8f5214d4001918fdb Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 00:24:13 +0000 Subject: [PATCH] refactor: convert logical operator to optional chainining The [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) operator can be used to perform null checks before accessing a property, or calling a function. --- packages/karbon/src/runtime/composables/resources.ts | 2 +- packages/karbon/src/track.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/karbon/src/runtime/composables/resources.ts b/packages/karbon/src/runtime/composables/resources.ts index 918b8ed5..bdf8f9a1 100644 --- a/packages/karbon/src/runtime/composables/resources.ts +++ b/packages/karbon/src/runtime/composables/resources.ts @@ -155,5 +155,5 @@ async function convertToId(scope: PayloadScope, resourceID: any): Promise { } const thunk = findCacheDirectory({ name: 'storipress', thunk: true }) - const cachePath = thunk && thunk('cli-cache') + const cachePath = thunk?.('cli-cache') const storage = createStorage({ driver: fsDriver({ base: cachePath }), })