question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Given something like

  export interface Person {
    status: MaritalStatus;
  }

  enum MaritalStatus {
    Married = 0,
    Single = 1,
  }

Is there a way to get the enum name and literals while introspecting Person type property (getType<Person>().getProperties()[0])?

I see that the property type kind is Container which totally makes sense, but cannot find neither the enum name nor its value names.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hugebducommented, Feb 6, 2022

@Hookyns confirmed! Thanks a lot! Great lib, really like the idea, will see if I can use it for my use case (ORM schema definition via TS)

1reaction
hugebducommented, Feb 3, 2022

@Hookyns you’re blazingly fast! ))) Thanks a lot, will take a look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

enum — Support for enumerations — Python 3.11.1 ...
enum — Support for enumerations¶ · is a set of symbolic names (members) bound to unique values · can be iterated over to...
Read more >
Handbook - Enums - TypeScript
Enums allow a developer to define a set of named constants. Using enums can make it easier to document intent, or create a...
Read more >
Documentation: 15: 8.7. Enumerated Types - PostgreSQL
Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in...
Read more >
PHP 8.1: Enums
PHP 8.1 adds support for Enumerations. An Enumeration, or an Enum for short, is an enumerated type that has a fixed number of...
Read more >
Java Enums - W3Schools
Enums. An enum is a special "class" that represents a group of constants (unchangeable variables, like final variables). To create an enum ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found