( json: any, type: TypeAnnotation, superJson: SuperJSON )
| 343 | }); |
| 344 | |
| 345 | export const untransformValue = ( |
| 346 | json: any, |
| 347 | type: TypeAnnotation, |
| 348 | superJson: SuperJSON |
| 349 | ) => { |
| 350 | if (isArray(type)) { |
| 351 | switch (type[0]) { |
| 352 | case 'symbol': |
| 353 | return symbolRule.untransform(json, type, superJson); |
| 354 | case 'class': |
| 355 | return classRule.untransform(json, type, superJson); |
| 356 | case 'custom': |
| 357 | return customRule.untransform(json, type, superJson); |
| 358 | case 'typed-array': |
| 359 | return typedArrayRule.untransform(json, type, superJson); |
| 360 | default: |
| 361 | throw new Error('Unknown transformation: ' + type); |
| 362 | } |
| 363 | } else { |
| 364 | const transformation = simpleRulesByAnnotation[type]; |
| 365 | if (!transformation) { |
| 366 | throw new Error('Unknown transformation: ' + type); |
| 367 | } |
| 368 | |
| 369 | return transformation.untransform(json as never, superJson); |
| 370 | } |
| 371 | }; |
no test coverage detected
searching dependent graphs…