(value: unknown, label: string)
| 1047 | } |
| 1048 | |
| 1049 | function stringArray(value: unknown, label: string): readonly string[] { |
| 1050 | if (!Array.isArray(value) || value.length > SKILL_CATALOG_STRING_ARRAY_MAX_ITEMS) { |
| 1051 | throw invalidProtocolFrame(`Invalid ${label}`); |
| 1052 | } |
| 1053 | return value.map((item) => utf8String(item, label, SKILL_CATALOG_STRING_ARRAY_ITEM_MAX_BYTES)); |
| 1054 | } |
| 1055 | |
| 1056 | function validationCodes(value: unknown): readonly SkillCatalogValidationCode[] { |
| 1057 | return stringArray(value, 'skill validation codes').map(validationCode); |
no test coverage detected