cacache
cacache copied to clipboard
[BUG] calling verify() should not modify the time property
What / Why
Documentation says about property time: Timestamp the entry was first added on.
Running cacache.verify()
internally uses insert()
method and sets time property to Date.now()
.
This is not what user expects and it makes the time property unusable.
How
const cachePath = '/tmp/cacache'
const key = 'key'
await cacache.put(cachePath, key, 'hello')
const item1 = await cacache.get.info(cachePath, key)
await cacache.verify(cachePath)
const item2 = await cacache.get.info(cachePath, key)
console.log(item1.time, item2.time, item1.time === item2.time ? 'ok' : 'WRONG')