( value: string, validPicks: Iterable<string>, )
| 230 | * stays empty (an intentional skip). |
| 231 | */ |
| 232 | export function canonicalizeOnePageFileValue( |
| 233 | value: string, |
| 234 | validPicks: Iterable<string>, |
| 235 | ): string { |
| 236 | if (!value) return value; |
| 237 | for (const pick of validPicks) { |
| 238 | if (value === pick) return value; |
| 239 | } |
| 240 | return `${FILE_CUSTOM_PREFIX}${value}`; |
| 241 | } |
| 242 | |
| 243 | /** Decode a stored FILE variable value into its representation kind. */ |
| 244 | export function decodeFileValue(stored: unknown): DecodedFileValue { |
no outgoing calls
no test coverage detected