Skip to content

Commit bb869dc

Browse files
committed
refactor
1 parent b9a172f commit bb869dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

TS.fsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ let EmitEnums () =
212212

213213
let EmitProperties flavor prefix (emitScope: EmitScope) (i: Browser.Interface)=
214214
let emitPropertyFromJson (p: ItemsType.Root) =
215-
let readOnlyModifier = if p.Readonly.IsSome && p.Readonly.Value = true && prefix = "" then "readonly " else ""
215+
let readOnlyModifier =
216+
match p.Readonly with
217+
| Some(true) -> "readonly "
218+
| _ -> ""
216219
Pt.printl "%s%s%s: %s;" prefix readOnlyModifier p.Name.Value p.Type.Value
217220

218221
let emitProperty (p: Browser.Property) =

0 commit comments

Comments
 (0)