Skip to content

Object.values on an enum with template literal values #3329

Closed
@Hacksore

Description

Repro: https://github.com/Hacksore/test-ts-objects-literals

This only happens with esbuild and when you use template literal values.

I can't repro on tsplayground

repro code

const staticMember = "static";

enum TemplateLiteral {
  Minecraft = `minecraft_${staticMember}`,
  Lol = `lol_${staticMember}`,
}

console.log(Object.values(TemplateLiteral);

expected

[ 'minecraft_static', 'lol_static' ]

actual

[ 'minecraft_static', 'Minecraft', 'lol_static', 'Lol' ]

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions