79092422

Date: 2024-10-16 04:04:29
Score: 2.5
Natty:
Report link

You told us that the myObject is {...someObject} as const. Did you also define someObject to be as const?

const a = {
  a: 0,
  b: 1,
};

const b = {
  ...a
} as const;

type B = typeof b[keyof typeof b]; // number
const a = {
  a: 0,
  b: 1,
} as const;

const b = {
  ...a
} as const;

type B = typeof b[keyof typeof b]; // 0 | 1
Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: dlguswo333