The has() method of the "PreviewCache" class probably won't work
Opened this issue · 1 comments
The has()
method should verify whether the cache data corresponding to the url specified in the argument exists.
However, the code when using the flat-cache
package is probably not in line with its purpose.
See line 47:
metalsmith-netlify-published-date/src/cache/preview.ts
Lines 43 to 49 in c77a135
This code always looks like reading the cached data stored in the url
property.
Is the correct code not this? :
return this.isCachedPreviewResponseJSON(this._store.all()[url]);
// ^^^^^
Thank you for pointing out important issues!
Perhaps I wrote this code while sleeping 💦
Fortunately, we do not use the PreviewCache
class has()
method at now.
has()
method was added to make it work as a Map class compatible interface.
However, this bug may cause problems if you use the has()
method in the future.
This project requires test code of PreviewCache
class.