Skip to content

improve shouldExtractLiteralValuesFromEnum #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 1, 2021

Conversation

angular-moon
Copy link
Contributor

More accurate determination of enumeration type and return the expected enumeration value

fixed: the following example does not generate an enumerated type

export enum Mode {
  A,
  B,
}

export enum Mode {
  A,
  B = "b",
}

fixed: return the expected enumeration value

export enum Mode {
 A,
 B = "b",
}

// old generated 
"type": {
   "name": "enum",
   "raw": "Mode",
   "value": [
     {
       "value": "Mode.A"
     },
     {
       "value": "\"b\""
     }
   ]
 }

// new generated 
"type": {
   "name": "enum",
   "raw": "Mode",
   "value": [
     {
       "value": "0"
     },
     {
       "value": "\"b\""
     }
   ]
 }

More accurate determination of enumeration type and return the expected enumeration value
@angular-moon
Copy link
Contributor Author

@pvasek Can you merge this PR?

@pvasek pvasek merged commit 08776ee into styleguidist:master Mar 1, 2021
@pvasek
Copy link
Collaborator

pvasek commented Apr 4, 2021

@angular-moon thanks a lot! Published on npm as v1.22.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants