mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
15 lines
306 B
TypeScript
15 lines
306 B
TypeScript
|
|
import { isNumberInRange } from '../numbers';
|
||
|
|
|
||
|
|
export function parseISO(input: string): number | null {
|
||
|
|
const values = input.split(',');
|
||
|
|
|
||
|
|
for (const value of values) {
|
||
|
|
const iso = Number.parseInt(value, 10);
|
||
|
|
if (isNumberInRange(iso, 0, 2 ** 32)) {
|
||
|
|
return iso;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return null;
|
||
|
|
}
|