mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-02 21:45:14 +01:00
feat(utils): export tryParse from verion utils
This commit is contained in:
@@ -8,7 +8,7 @@ export const isVersionArray = (arr: unknown): arr is VersionArray =>
|
||||
arr.length === 3 &&
|
||||
arr.every(number => typeof number === 'number' && number >= 0);
|
||||
|
||||
const tryParse = (version: string): VersionArray | null =>
|
||||
export const tryParse = (version: string): VersionArray | null =>
|
||||
version
|
||||
.match(/^(\d+)\.(\d+)\.(\d+)([+-].*)?$/) // three groups of digits separated by dot, optionally ending with '-whatever.123.@' or '+anything.456.#'
|
||||
?.slice(1, 4)
|
||||
|
||||
Reference in New Issue
Block a user