(value: T, encoding?: 'base64')
| 113 | } |
| 114 | |
| 115 | export function encodeEncoding<T>(value: T, encoding?: 'base64') { |
| 116 | if (typeof value !== 'string') { |
| 117 | return value; |
| 118 | } |
| 119 | |
| 120 | if (value.length === 0) { |
| 121 | return value; |
| 122 | } |
| 123 | |
| 124 | if (encoding === 'base64') { |
| 125 | const encodedValue = utf8ToBase64(value); |
| 126 | return `b64::${encodedValue}::46b`; |
| 127 | } |
| 128 | |
| 129 | return value; |
| 130 | } |
| 131 | |
| 132 | export function decodeEncoding<T>(value: T) { |
| 133 | if (typeof value !== 'string') { |
nothing calls this directly
no test coverage detected