MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / parseSemVer

Function parseSemVer

src/platform/common/utils.ts:421–429  ·  view source on GitHub ↗
(versionString: string)

Source from the content-addressed store, hash-verified

419
420// For the given string parse it out to a SemVer or return undefined
421export function parseSemVer(versionString: string): SemVer | undefined {
422 const versionMatch = /^\s*(\d+)\.(\d+)\.(.+)\s*$/.exec(versionString);
423 if (versionMatch && versionMatch.length > 2) {
424 const major = parseInt(versionMatch[1], 10);
425 const minor = parseInt(versionMatch[2], 10);
426 const build = parseInt(versionMatch[3], 10);
427 return parse(`${major}.${minor}.${build}`, true) ?? undefined;
428 }
429}
430
431type JupyterCellMetadata = Pick<nbformat.IRawCell, 'id' | 'metadata' | 'attachments'> &
432 Pick<nbformat.IMarkdownCell, 'id' | 'attachments'> &

Callers 2

getNbConvertVersionMethod · 0.90
getVersionFunction · 0.90

Calls 2

execMethod · 0.65
parseFunction · 0.50

Tested by

no test coverage detected