In my application, I am working with JSON data. Here is a simplified example:
data {
prop1: "abc",
prop2: 123,
COL_A12: "mydata",
COL_A13: "myotherdata",
}
I am aware that the data will consist of multiple prop1 and prop2 properties. However, COL_A12 and COL_A13 are dynamically generated, so they could have different names (e.g., COL_A67).
I have defined an interface as follows:
interface IData {
prop1: string;
prop2: number;
}
Unfortunately, I cannot specify the other property names in the interface due to their dynamic nature. They do follow a pattern, though.
Is there a way to use regular expressions for property names in Typescript?