Converting JSON-Encoded Environment Variables to BigInt Arrays in TypeScript

I've got an application which is configured via env vars, which most of the time contain JOSN encoded values.
How could I use Config to turn an env var containing, say, an array of strings representing bigInt vales, like: ["10000000000000000000000000","2","3"]) into an array of bigint's?

He's what I've got:
const ListOfBigIntsFromJSONConfig = pipe(
  Config.string('LIST_OF_BIG_INTS'),
  S.decodeUnknownEither(S.parseJson(S.array(S.bigint))),
  Either.mapLeft(error => ConfigError.InvalidData([], error.message)),
)


Is this the way to do it?
Was this page helpful?