Understanding Unexpected Return Type in TypeScript Pipeline

Hey, I think I'm shooting myself on the foot here. Can someone explain me why I'm getting back a Record<string, unknown>[] rather than an either?
    const json: unknown = parser.parse(Buffer.from(xmlContent));
    const cleanedData = yield* pipe(
      json,
      Schema.decodeUnknownEither(XmlSchema, {
        onExcessProperty: "preserve",
      }),
      Effect.andThen((x) => x["d2:payload"]["egi:energyInfrastructureTable"]),
      Effect.andThen(A.map(Record.mapKeys((k) => k.replace("fac:", ""))))
    );
    yield* Console.log(cleanedData);
  })

Is because andThen is magically unwrapping stuff?
Was this page helpful?