import { fieldsAuto , string } from "../" ; test ( "decoding unknown values" , ( ) => { type Message = { text : string ; data : unknown ; } ; const message = { text : "Hello, world!" , data : 15 } ; const messageDecoder1 = fieldsAuto < Message > ( { text : string , data : ( value ) => value , } ) ; expect ( messageDecoder1 ( message ) ) . toMatchInlineSnapshot ( `
    Object {
      "data": 15,
      "text": "Hello, world!",
    }
  ` ) ; const identity = < T > ( value ) : T => value ; const unknown = identity ; const messageDecoder2 = fieldsAuto < Message > ( { text : string , data : unknown , } ) ; expect ( messageDecoder2 ( message ) ) . toMatchInlineSnapshot ( `
    Object {
      "data": 15,
      "text": "Hello, world!",
    }
  ` ) ; } ) ;