import { Assert, Size, SIZE_STRING_PATTERN, text } from '@rsdk/common'; import type { PropertyParser } from '../../types'; export class SizeParser implements PropertyParser { type(): string { return 'Timespan'; } description(): string { return text` Parses string in size format into Timespan instance. Format is: ${SIZE_STRING_PATTERN}. For example: 8b, 10kb, 2gb. `; } parse(value: unknown): Size { Assert.isString(value); return Size.parse(value); } }