Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fixed blank resourceId on JsonGet
Browse files Browse the repository at this point in the history
  • Loading branch information
tycrek committed Jul 6, 2021
1 parent 6ea9b56 commit bf6f8c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions JsonStorageEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ function save(resolve, reject) {
*/
function JsonGetFunc(resourceId) {
return new Promise((resolve, reject) =>
(STORAGE.DATA.has(resourceId))
? resolve(resourceId === undefined ? Array.from(STORAGE.DATA.entries()) : STORAGE.DATA.get(resourceId))
: reject(new KeyNotFoundError()));
(resourceId === undefined)
? resolve(Array.from(STORAGE.DATA.entries()))
: (STORAGE.DATA.has(resourceId))
? resolve(STORAGE.DATA.get(resourceId))
: reject(new KeyNotFoundError()));
}

/**
Expand Down

0 comments on commit bf6f8c8

Please sign in to comment.