(rTyped: REncoded<T>)
| 53 | * decodeRValue([RType.STANDARD, 123]) // 123 |
| 54 | */ |
| 55 | export const decodeRValue = <T = unknown>(rTyped: REncoded<T>) => { |
| 56 | switch (rTyped[0]) { |
| 57 | case RType.UNDEFINED: |
| 58 | return undefined; |
| 59 | case RType.NULL: |
| 60 | return null; |
| 61 | default: |
| 62 | return rTyped[1] as T; |
| 63 | } |
| 64 | }; |
| 65 | |
| 66 | /** |
| 67 | * encodeRValue |
no outgoing calls
no test coverage detected