Skip to content

Commit 40eeab4

Browse files
committed
refactor: omit some options from bentocache options
1 parent b41e9e7 commit 40eeab4

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

packages/bentocache/src/types/options/options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export type RawBentoCacheOptions = {
110110
* Custom serializer
111111
*/
112112
serializer?: CacheSerializer
113-
} & RawCommonOptions
113+
} & Omit<RawCommonOptions, 'tags' | 'skipBusNotify' | 'skipL2Write'>
114114

115115
/**
116116
* The options that can be passed when creating

packages/bentocache/tests/bento_cache.spec.ts

+25
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,29 @@ test.group('Bento Cache', () => {
241241

242242
assert.equal(bento.defaultStoreName, 'primary')
243243
})
244+
245+
test('should not accept some options', async () => {
246+
const opts = {
247+
default: 'memory',
248+
stores: { memory: bentostore().useL1Layer(memoryDriver({})) },
249+
}
250+
251+
new BentoCache({
252+
...opts,
253+
// @ts-expect-error invalid option
254+
tags: ['foo'],
255+
})
256+
257+
new BentoCache({
258+
...opts,
259+
// @ts-expect-error invalid option
260+
skipBusNotify: true,
261+
})
262+
263+
new BentoCache({
264+
...opts,
265+
// @ts-expect-error invalid option
266+
skipL2Write: true,
267+
})
268+
})
244269
})

0 commit comments

Comments
 (0)