Files
klz-cables.com/.pnpm-store/v10/files/ef/85624c649a3b3cde8b65cf21cc0b4a9b202d5a5cb7ec28208cf9eb8b88ae6873a4d5e87e78f6712bc8be848eae139c67482dc2d829035314fb0743085dfde6
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

33 lines
984 B
Plaintext

import { createRequire } from 'module';
function getCurrentVersion() {
try {
const require = createRequire(import.meta.url);
const pkg = require('next/package.json');
return pkg.version;
} catch (error) {
throw new Error('Failed to get current Next.js version. This can happen if next-intl/plugin is imported into your app code outside of your next.config.js.', {
cause: error
});
}
}
function compareVersions(version1, version2) {
const v1Parts = version1.split('.').map(Number);
const v2Parts = version2.split('.').map(Number);
for (let i = 0; i < 3; i++) {
const v1 = v1Parts[i] || 0;
const v2 = v2Parts[i] || 0;
if (v1 > v2) return 1;
if (v1 < v2) return -1;
}
return 0;
}
function hasStableTurboConfig() {
return compareVersions(getCurrentVersion(), '15.3.0') >= 0;
}
function isNextJs16OrHigher() {
return compareVersions(getCurrentVersion(), '16.0.0') >= 0;
}
export { hasStableTurboConfig, isNextJs16OrHigher };