Closed micalevisk closed 1 year ago
Now users can optionally supply the type of the parsed data like the following:
const myData = toml.parse<MyData>(myInput); // ^? MyData
instead of doing
const myData: MyData = toml.parse(myInput);
Notice that the default type is still any thus both approach above works.
any
As an workaround to this, I augmented toml with this ambient file:
toml
toml.d.ts
Hi @BinaryMuse! can you please review this one? it should be pretty straightforward :smiley:
I fond that this is a bad style. We should return unknown instead
unknown
Now users can optionally supply the type of the parsed data like the following:
instead of doing
Notice that the default type is still
any
thus both approach above works.As an workaround to this, I augmented
toml
with this ambient file:
```ts declare module 'toml' { export function parsetoml.d.ts