File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -531,8 +531,26 @@ let EmitDictionaries flavor =
531
531
| " Object" -> Pt.printl " interface %s {" dict.Name
532
532
| _ -> Pt.printl " interface %s extends %s {" dict.Name dict.Extends
533
533
534
+ let emitJsonProperty ( p : ItemsType.Root ) =
535
+ Pt.printl " %s : %s ;" p.Name.Value p.Type.Value
536
+
537
+ let removedPropNames =
538
+ getRemovedItems ItemKind.Property flavor
539
+ |> Array.filter ( matchInterface dict.Name)
540
+ |> Array.map ( fun rp -> rp.Name.Value)
541
+ |> Set.ofArray
542
+ let addedProps =
543
+ getAddedItems ItemKind.Property flavor
544
+ |> Array.filter ( matchInterface dict.Name)
545
+
534
546
Pt.increaseIndent()
535
- dict.Members |> Array.iter ( fun m -> Pt.printl " %s ?: %s ;" m.Name ( DomTypeToTsType m.Type))
547
+ Array.iter emitJsonProperty addedProps
548
+ dict.Members
549
+ |> Array.filter ( fun m -> not ( Set.contains m.Name removedPropNames))
550
+ |> Array.iter ( fun m ->
551
+ match ( findOverriddenItem m.Name ItemKind.Property dict.Name) with
552
+ | Some om -> emitJsonProperty om
553
+ | None -> Pt.printl " %s ?: %s ;" m.Name ( DomTypeToTsType m.Type))
536
554
Pt.decreaseIndent()
537
555
Pt.printl " }"
538
556
Pt.printl " "
You can’t perform that action at this time.
0 commit comments