glutinum-org / cli

Home Page:https://glutinum.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

String enum containing a dot should be escaped

MangelMaxime opened this issue · comments

Issue created from Glutinum Tool

Glutinum version - 0.4.0

TypeScript

type FirebaseSignInProvider =
    | 'apple.com';

FSharp

module rec Glutinum

open Fable.Core
open Fable.Core.JsInterop
open System

[<RequireQualifiedAccess>]
[<StringEnum(CaseRules.None)>]
type FirebaseSignInProvider =
    | apple.com

Problem description

The generated code is invalid in F#.

It seems like we can't use the double tick trick when there is . in the name, so we will need to transform into a CompiledName

[<RequireQualifiedAccess>]
[<StringEnum(CaseRules.None)>]
type FirebaseSignInProvider =
    | [<CompiledName("apple.com")>] apple_com