Skip to content

Commit ce977bd

Browse files
authored
Fixed kind property for next 15 (#2)
* Version bump * Fixed `kind` property for next 15
1 parent 6a5ddb7 commit ce977bd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/nextjs-cache-handler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"type": "git",
1111
"url": "git+https://github.com/fortedigital/nextjs-cache-handler.git"
1212
},
13-
"version": "1.1.0",
13+
"version": "1.1.1",
1414
"type": "module",
1515
"license": "MIT",
1616
"description": "Next.js cache handlers",

packages/nextjs-cache-handler/src/handlers/buffer-string-decorator.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export default function bufferStringDecorator(handler: Handler): Handler {
1919
const hit = await handler.get(key, ctx);
2020
const staticPageCacheData =
2121
hit?.value as unknown as ConvertedStaticPageCacheData;
22-
if (hit?.value && staticPageCacheData?.body) {
22+
if (
23+
hit?.value &&
24+
(staticPageCacheData?.kind as string) === "APP_ROUTE" &&
25+
staticPageCacheData?.body
26+
) {
2327
return {
2428
...hit,
2529
value: {
@@ -32,8 +36,8 @@ export default function bufferStringDecorator(handler: Handler): Handler {
3236
},
3337

3438
async set(key, data) {
35-
const routeValue = data.value as CachedRouteValue;
36-
if (routeValue?.kind === "ROUTE" && routeValue?.body) {
39+
const routeValue = data.value as unknown as CachedRouteValue;
40+
if ((routeValue?.kind as string) === "APP_ROUTE" && routeValue?.body) {
3741
await handler.set(key, {
3842
...data,
3943
value: {

0 commit comments

Comments
 (0)