Here's the interface I'm working with:
interface Test {
data: string[]
}
const DATA_LIST = {
USER: ["some string"],
OTHER: ["some other string", "random value", "etc"]
} as const;
const test : Test = {
data: DATA_LIST.OTHER
}
The issue arises when I try to assign DATA_LIST.OTHER
to data
, as my use case requires assigning multiple tuples to data.
This assignment doesn't work because data
only accepts string[]
, while I am attempting to assign a readonly tuple.
Is there a more efficient way to achieve this?