@@ -100,11 +100,12 @@ module FieldMergeFunction = {
100100 // incoming: SafeReadonly<TIncoming>,
101101 // options: TOptions,
102102 // ) => SafeReadonly<TExisting>;
103- type t <'existing > = ('existing , 'existing , FieldFunctionOptions .Js_ .t ) => 'existing
103+ type t <'existing > = (. 'existing , 'existing , FieldFunctionOptions .Js_ .t ) => 'existing
104104 }
105105
106- let toJs : t <'existing > => Js_ .t <'existing > = (t , existing , incoming , jsFieldFunctionOptions ) =>
107- t (existing , incoming , jsFieldFunctionOptions -> FieldFunctionOptions .fromJs )
106+ let toJs : (. t <'existing >) => Js_ .t <'existing > = (. t ) =>
107+ (. existing , incoming , jsFieldFunctionOptions ) =>
108+ t (existing , incoming , jsFieldFunctionOptions -> FieldFunctionOptions .fromJs )
108109}
109110
110111module FieldMerge = {
@@ -116,22 +117,22 @@ module FieldMerge = {
116117 // FieldMergeFunction<TExisting, TIncoming, TOptions> | boolean;
117118 module FieldMergeUnion : {
118119 type t <'existing >
119- let mergeFunction : FieldMergeFunction .Js_ .t <'existing > => t <'existing >
120+ let mergeFunction : (. FieldMergeFunction .Js_ .t <'existing >) => t <'existing >
120121 let true_ : t <'existing >
121122 } = {
122123 @unboxed
123124 type rec t <'existing > = Any ('a ): t <'existing >
124- let mergeFunction = (v : FieldMergeFunction .Js_ .t <'existing >) => Any (v )
125+ let mergeFunction = (. v : FieldMergeFunction .Js_ .t <'existing >) => Any (v )
125126 let true_ = Any (true )
126127 }
127128
128129 type t <'existing > = FieldMergeUnion .t <'existing >
129130 }
130131
131- let toJs : t <'existing > => Js_ .t <'existing > = x =>
132+ let toJs : (. t <'existing >) => Js_ .t <'existing > = (. x ) =>
132133 switch x {
133134 | MergeFunction (mergeFunction ) =>
134- mergeFunction -> FieldMergeFunction .toJs -> Js_ . FieldMergeUnion . mergeFunction
135+ Js_ . FieldMergeUnion . mergeFunction (. FieldMergeFunction .toJs (. mergeFunction ))
135136 | True => Js_ .FieldMergeUnion .true_
136137 }
137138}
@@ -141,11 +142,12 @@ module FieldReadFunction = {
141142
142143 module Js_ = {
143144 // export declare type FieldReadFunction<TExisting = any, TReadResult = TExisting> = (existing: SafeReadonly<TExisting> | undefined, options: FieldFunctionOptions) => TReadResult | undefined;
144- type t <'existing > = (option <'existing >, FieldFunctionOptions .Js_ .t ) => 'existing
145+ type t <'existing > = (. option <'existing >, FieldFunctionOptions .Js_ .t ) => 'existing
145146 }
146147
147- let toJs : t <'existing > => Js_ .t <'existing > = (t , existing , jsFieldFunctionOptions ) =>
148- t (existing , jsFieldFunctionOptions -> FieldFunctionOptions .fromJs )
148+ let toJs : (. t <'existing >) => Js_ .t <'existing > = (. t ) =>
149+ (. existing , jsFieldFunctionOptions ) =>
150+ t (existing , jsFieldFunctionOptions -> FieldFunctionOptions .fromJs )
149151}
150152
151153module KeySpecifier = {
@@ -200,7 +202,7 @@ module FieldPolicy_KeyArgs = {
200202 type t = KeyArgsUnion .t
201203 }
202204
203- let toJs : t => Js_ .t = x =>
205+ let toJs : (. t ) => Js_ .t = (. x ) =>
204206 switch x {
205207 | KeySpecifier (keySpecifier ) => keySpecifier -> Js_ .KeyArgsUnion .keySpecifier
206208 | KeyArgsFunction (keyArgsFunction ) => keyArgsFunction -> Js_ .KeyArgsUnion .keyArgsFunction
@@ -229,8 +231,8 @@ module FieldPolicy = {
229231 }
230232
231233 let toJs : t <'existing > => Js_ .t <'existing > = t => {
232- keyArgs : ?t .keyArgs -> Belt .Option .map (FieldPolicy_KeyArgs .toJs ),
233- read : ?t .read -> Belt .Option .map (FieldReadFunction .toJs ),
234- merge : ?t .merge -> Belt .Option .map (FieldMerge .toJs ),
234+ keyArgs : ?t .keyArgs -> Belt .Option .mapU (FieldPolicy_KeyArgs .toJs ),
235+ read : ?t .read -> Belt .Option .mapU (FieldReadFunction .toJs ),
236+ merge : ?t .merge -> Belt .Option .mapU (FieldMerge .toJs ),
235237 }
236238}
0 commit comments