@practicaloptimism/uniplexer
Version:
A multiplexer for 3rd party service providers and application protocols
21 lines (14 loc) • 515 B
text/typescript
import { DoesExistItem } from '../../../@utility/data-structures/database'
import { storeTable } from '../variables'
import { createItemStore } from './create-item-store'
const doesExistItem: DoesExistItem = doesExistItemFunction
async function doesExistItemFunction (storeId: string, itemId: string): Promise<boolean[]> {
if (!storeTable[storeId]) {
await createItemStore(storeId)
}
const item = await storeTable[storeId].getItem(itemId)
return [item ? true : false]
}
export {
doesExistItem
}