visual-journal / scripts /node-version.mjs
gpt-image-playground deploy
Deploy 912aa68 to Docker Space
704e84f
Raw
History Blame Contribute Delete
579 Bytes
const minimumNodeVersion = [22, 15, 0];
export const MIN_NODE_VERSION_RANGE = '>=22.15.0';
export function isSupportedNodeVersion(version = process.version) {
const match = /^v?(\d+)\.(\d+)\.(\d+)(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/.exec(version);
if (!match) return false;
const current = match.slice(1, 4).map(Number);
for (let index = 0; index < minimumNodeVersion.length; index += 1) {
if (current[index] > minimumNodeVersion[index]) return true;
if (current[index] < minimumNodeVersion[index]) return false;
}
return true;
}