I have a node.js project where I successfully use a custom mapped type
export type Mutable<T> = {
-readonly [P in keyof T]: T[P];
};
but if I add the same code to an Angular 6 project, compilation fails saying:
ERROR in src/assets/scripts/utils.ts(2,5): error TS1131: Property or signature expected.
src/assets/scripts/utils.ts(2,27): error TS1005: ']' expected.
src/assets/scripts/utils.ts(2,28): error TS1005: ';' expected.
src/assets/scripts/utils.ts(14,29): error TS1128: Declaration or statement expected.
src/assets/scripts/utils.ts(3,1): error TS1128: Declaration or statement expected.
Why does this happen and how can I solve?
Thank you all in advance!!