fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Replace TS enums by plain objects

Open arobsn opened this issue 2 years ago • 0 comments

TypeScript Enums are bad, consider replacing them by plain objects for improved compatibility and efficiency.

Plain object enum example:

export const ergoTreeHeaderFlags = {
  sizeInclusion: 0x08,
  constantSegregation: 0x10
} as const;

export type ErgoTreeHeaderFlag = (typeof ergoTreeHeaderFlags)[keyof typeof ergoTreeHeaderFlags];

arobsn avatar Sep 06 '23 02:09 arobsn