(versionString: string)
| 419 | |
| 420 | // For the given string parse it out to a SemVer or return undefined |
| 421 | export 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 | |
| 431 | type JupyterCellMetadata = Pick<nbformat.IRawCell, 'id' | 'metadata' | 'attachments'> & |
| 432 | Pick<nbformat.IMarkdownCell, 'id' | 'attachments'> & |
no test coverage detected