Files
twenty/packages/twenty-server/src/utils/version/extract-version-major-minor-patch.ts
T
Paul RastoinandGitHub 23b4605987 [REFACTOR] Workspace version only x.y.z (#10910)
# Introduction
We want the APP_VERSION to be able to contains pre-release options, in a
nutshell to be semVer compatible.
But we want to have workspace, at least for the moment, that only store
`x.y.z` and not `vx.y.z` or `x.y.z-alpha` version in database

Explaining this refactor

Related https://github.com/twentyhq/twenty/pull/10907
2025-03-14 19:21:44 +01:00

12 lines
261 B
TypeScript

import semver from 'semver';
export const extractVersionMajorMinorPatch = (version: string | undefined) => {
const parsed = semver.parse(version);
if (parsed === null) {
return null;
}
return `${parsed.major}.${parsed.minor}.${parsed.patch}`;
};