Files
klz-cables.com/.pnpm-store/v10/files/ad/3f72d7023ce10481ca5c0766f322be3e475d25a831d72cd8c2c6833b53733ddd5dce3e02708892ac743984cca97f06555cfea519301abcd366d7d0a7db27d8
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

49 lines
1.4 KiB
Plaintext

// Vendored from: https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/client-and-server-references.ts
function extractInfoFromServerReferenceId(id) {
const infoByte = parseInt(id.slice(0, 2), 16);
// eslint-disable-next-line no-bitwise
const typeBit = (infoByte >> 7) & 0x1;
// eslint-disable-next-line no-bitwise
const argMask = (infoByte >> 1) & 0x3f;
// eslint-disable-next-line no-bitwise
const restArgs = infoByte & 0x1;
const usedArgs = Array(6);
for (let index = 0; index < 6; index++) {
const bitPosition = 5 - index;
// eslint-disable-next-line no-bitwise
const bit = (argMask >> bitPosition) & 0x1;
usedArgs[index] = bit === 1;
}
return {
type: typeBit === 1 ? 'use-cache' : 'server-action',
usedArgs: usedArgs ,
hasRestArgs: restArgs === 1,
};
}
function isServerReference(value) {
return value.$$typeof === Symbol.for('react.server.reference');
}
/**
* Check if the function is a use cache function.
*
* @param value - The function to check.
* @returns true if the function is a use cache function, false otherwise.
*/
function isUseCacheFunction(value) {
if (!isServerReference(value)) {
return false;
}
const { type } = extractInfoFromServerReferenceId(value.$$id);
return type === 'use-cache';
}
export { isUseCacheFunction };
//# sourceMappingURL=isUseCacheFunction.js.map