@kaiko.io/rescript-deser 3.1.3 → 4.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,42 +12,54 @@ var FieldValue = {};
12
12
 
13
13
  var $$TypeError = /* @__PURE__ */Caml_exceptions.create("JSON.TypeError");
14
14
 
15
- function usingString(f, value) {
16
- return Curry._1(f, value);
15
+ function usingString(f) {
16
+ return function (value) {
17
+ return f(value);
18
+ };
17
19
  }
18
20
 
19
- function usingInt(f, value) {
20
- return Curry._1(f, value);
21
+ function usingInt(f) {
22
+ return function (value) {
23
+ return f(value);
24
+ };
21
25
  }
22
26
 
23
- function usingFloat(f, value) {
24
- return Curry._1(f, value);
27
+ function usingFloat(f) {
28
+ return function (value) {
29
+ return f(value);
30
+ };
25
31
  }
26
32
 
27
- function usingBoolean(f, value) {
28
- return Curry._1(f, value);
33
+ function usingBoolean(f) {
34
+ return function (value) {
35
+ return f(value);
36
+ };
29
37
  }
30
38
 
31
- function usingArray(f, value) {
32
- return Curry._1(f, value);
39
+ function usingArray(f) {
40
+ return function (value) {
41
+ return f(value);
42
+ };
33
43
  }
34
44
 
35
- function usingObject(f, value) {
36
- return Curry._1(f, value);
45
+ function usingObject(f) {
46
+ return function (value) {
47
+ return f(value);
48
+ };
37
49
  }
38
50
 
39
51
  function variadicInt(hint, fromJs) {
40
52
  return {
41
- TAG: /* Morphism */10,
42
- _0: /* Int */2,
43
- _1: (function (param) {
44
- var internalValue = Curry._1(fromJs, param);
53
+ TAG: "Morphism",
54
+ _0: "Int",
55
+ _1: (function (value) {
56
+ var internalValue = fromJs(value);
45
57
  if (internalValue !== undefined) {
46
58
  return Caml_option.valFromOption(internalValue);
47
59
  }
48
60
  throw {
49
61
  RE_EXN_ID: $$TypeError,
50
- _1: "This Int(" + String(param) + ") not a valid value here. Hint: " + hint + "",
62
+ _1: "This Int(" + String(value) + ") not a valid value here. Hint: " + hint,
51
63
  Error: new Error()
52
64
  };
53
65
  })
@@ -56,16 +68,16 @@ function variadicInt(hint, fromJs) {
56
68
 
57
69
  function variadicString(hint, fromJs) {
58
70
  return {
59
- TAG: /* Morphism */10,
60
- _0: /* String */1,
61
- _1: (function (param) {
62
- var internalValue = Curry._1(fromJs, param);
71
+ TAG: "Morphism",
72
+ _0: "String",
73
+ _1: (function (value) {
74
+ var internalValue = fromJs(value);
63
75
  if (internalValue !== undefined) {
64
76
  return Caml_option.valFromOption(internalValue);
65
77
  }
66
78
  throw {
67
79
  RE_EXN_ID: $$TypeError,
68
- _1: "This String(\"" + param + "\") not a valid value here. Hint: " + hint + "",
80
+ _1: "This String(\"" + value + "\") not a valid value here. Hint: " + hint,
69
81
  Error: new Error()
70
82
  };
71
83
  })
@@ -73,50 +85,50 @@ function variadicString(hint, fromJs) {
73
85
  }
74
86
 
75
87
  function toString(type_) {
76
- if (typeof type_ === "number") {
88
+ if (typeof type_ !== "object") {
77
89
  switch (type_) {
78
- case /* Any */0 :
90
+ case "Any" :
79
91
  return "Any";
80
- case /* String */1 :
92
+ case "String" :
81
93
  return "String";
82
- case /* Int */2 :
94
+ case "Int" :
83
95
  return "Integer";
84
- case /* Float */3 :
96
+ case "Float" :
85
97
  return "Float";
86
- case /* Boolean */4 :
98
+ case "Boolean" :
87
99
  return "Boolean";
88
- case /* Date */5 :
89
- case /* Datetime */6 :
100
+ case "Date" :
101
+ case "Datetime" :
90
102
  return "Date";
91
- case /* Self */7 :
103
+ case "Self" :
92
104
  return "Self (recursive)";
93
105
 
94
106
  }
95
107
  } else {
96
- switch (type_.TAG | 0) {
97
- case /* Literal */0 :
98
- return "Literal: " + type_._0 + "";
99
- case /* Array */1 :
108
+ switch (type_.TAG) {
109
+ case "Literal" :
110
+ return "Literal: " + type_._0;
111
+ case "Array" :
100
112
  return "Array of " + toString(type_._0);
101
- case /* Tuple */2 :
113
+ case "Tuple" :
102
114
  return "Tuple of (" + Curry._2(Prelude.$$Array.map, type_._0, toString).join(", ") + ")";
103
- case /* Object */3 :
115
+ case "Object" :
104
116
  var desc = Curry._2(Prelude.$$Array.map, type_._0, (function (param) {
105
- return "" + param[0] + ": " + toString(param[1]) + "";
117
+ return param[0] + ": " + toString(param[1]);
106
118
  })).join(", ");
107
119
  return "Object of {" + desc + "}";
108
- case /* Optional */4 :
109
- case /* OptionalWithDefault */5 :
120
+ case "Optional" :
121
+ case "OptionalWithDefault" :
110
122
  return "Null of " + toString(type_._0);
111
- case /* Mapping */6 :
112
- return "Mapping of " + toString(type_._0) + "";
113
- case /* Deserializer */7 :
123
+ case "Mapping" :
124
+ return "Mapping of " + toString(type_._0);
125
+ case "Deserializer" :
114
126
  return type_._0.name;
115
- case /* Collection */8 :
127
+ case "Collection" :
116
128
  return "Collection of " + type_._0.name;
117
- case /* DefaultWhenInvalid */9 :
118
- return "Protected " + toString(type_._0) + "";
119
- case /* Morphism */10 :
129
+ case "DefaultWhenInvalid" :
130
+ return "Protected " + toString(type_._0);
131
+ case "Morphism" :
120
132
  return toString(type_._0) + " to apply a morphism";
121
133
 
122
134
  }
@@ -124,25 +136,25 @@ function toString(type_) {
124
136
  }
125
137
 
126
138
  function _taggedToString(tagged) {
127
- if (typeof tagged === "number") {
139
+ if (typeof tagged !== "object") {
128
140
  switch (tagged) {
129
- case /* JSONFalse */0 :
141
+ case "JSONFalse" :
130
142
  return "Boolean(false)";
131
- case /* JSONTrue */1 :
143
+ case "JSONTrue" :
132
144
  return "Boolean(true)";
133
- case /* JSONNull */2 :
145
+ case "JSONNull" :
134
146
  return "Null";
135
147
 
136
148
  }
137
149
  } else {
138
- switch (tagged.TAG | 0) {
139
- case /* JSONString */0 :
150
+ switch (tagged.TAG) {
151
+ case "JSONString" :
140
152
  return "String(\"" + tagged._0 + "\")";
141
- case /* JSONNumber */1 :
153
+ case "JSONNumber" :
142
154
  return "Number(" + String(tagged._0) + ")";
143
- case /* JSONObject */2 :
155
+ case "JSONObject" :
144
156
  return "Object(" + Prelude.$$default(JSON.stringify(tagged._0), "...") + ")";
145
- case /* JSONArray */3 :
157
+ case "JSONArray" :
146
158
  return "Array(" + Prelude.$$default(JSON.stringify(tagged._0), "...") + ")";
147
159
 
148
160
  }
@@ -152,14 +164,14 @@ function _taggedToString(tagged) {
152
164
  function extractValue(values, field, shape, self) {
153
165
  var value = Curry._2(Prelude.Dict.get, values, field);
154
166
  if (value !== undefined) {
155
- return fromUntagged(Caml_option.valFromOption(value), shape, self);
167
+ return fromUntagged(value, shape, self);
156
168
  }
157
- if (typeof shape !== "number") {
158
- switch (shape.TAG | 0) {
159
- case /* OptionalWithDefault */5 :
169
+ if (typeof shape === "object") {
170
+ switch (shape.TAG) {
171
+ case "OptionalWithDefault" :
160
172
  return shape._1;
161
- case /* Optional */4 :
162
- case /* DefaultWhenInvalid */9 :
173
+ case "Optional" :
174
+ case "DefaultWhenInvalid" :
163
175
  return fromUntagged(null, shape, self);
164
176
  default:
165
177
 
@@ -179,66 +191,64 @@ function fromUntagged(untagged, _shape, self) {
179
191
  var exit = 0;
180
192
  var s;
181
193
  var f;
182
- if (typeof shape === "number") {
194
+ if (typeof shape !== "object") {
183
195
  switch (shape) {
184
- case /* Any */0 :
196
+ case "Any" :
185
197
  return untagged;
186
- case /* String */1 :
187
- if (typeof match === "number") {
198
+ case "String" :
199
+ if (typeof match !== "object") {
188
200
  exit = 1;
189
201
  } else {
190
- if (match.TAG === /* JSONString */0) {
202
+ if (match.TAG === "JSONString") {
191
203
  return match._0;
192
204
  }
193
205
  exit = 1;
194
206
  }
195
207
  break;
196
- case /* Int */2 :
197
- if (typeof match === "number") {
208
+ case "Int" :
209
+ if (typeof match !== "object") {
198
210
  exit = 1;
199
211
  } else {
200
- if (match.TAG === /* JSONNumber */1) {
212
+ if (match.TAG === "JSONNumber") {
201
213
  return match._0 | 0;
202
214
  }
203
215
  exit = 1;
204
216
  }
205
217
  break;
206
- case /* Float */3 :
207
- if (typeof match === "number") {
218
+ case "Float" :
219
+ if (typeof match !== "object") {
208
220
  exit = 1;
209
221
  } else {
210
- if (match.TAG === /* JSONNumber */1) {
222
+ if (match.TAG === "JSONNumber") {
211
223
  return match._0;
212
224
  }
213
225
  exit = 1;
214
226
  }
215
227
  break;
216
- case /* Boolean */4 :
217
- if (typeof match === "number") {
228
+ case "Boolean" :
229
+ if (typeof match !== "object") {
218
230
  switch (match) {
219
- case /* JSONFalse */0 :
231
+ case "JSONFalse" :
220
232
  return false;
221
- case /* JSONTrue */1 :
233
+ case "JSONTrue" :
222
234
  return true;
223
- case /* JSONNull */2 :
224
- exit = 1;
225
- break;
226
-
235
+ default:
236
+ exit = 1;
227
237
  }
228
238
  } else {
229
239
  exit = 1;
230
240
  }
231
241
  break;
232
- case /* Date */5 :
233
- if (typeof match === "number") {
242
+ case "Date" :
243
+ if (typeof match !== "object") {
234
244
  exit = 1;
235
245
  } else {
236
- switch (match.TAG | 0) {
237
- case /* JSONString */0 :
246
+ switch (match.TAG) {
247
+ case "JSONString" :
238
248
  s = match._0;
239
249
  exit = 2;
240
250
  break;
241
- case /* JSONNumber */1 :
251
+ case "JSONNumber" :
242
252
  f = match._0;
243
253
  exit = 3;
244
254
  break;
@@ -247,16 +257,16 @@ function fromUntagged(untagged, _shape, self) {
247
257
  }
248
258
  }
249
259
  break;
250
- case /* Datetime */6 :
251
- if (typeof match === "number") {
260
+ case "Datetime" :
261
+ if (typeof match !== "object") {
252
262
  exit = 1;
253
263
  } else {
254
- switch (match.TAG | 0) {
255
- case /* JSONString */0 :
264
+ switch (match.TAG) {
265
+ case "JSONString" :
256
266
  s = match._0;
257
267
  exit = 2;
258
268
  break;
259
- case /* JSONNumber */1 :
269
+ case "JSONNumber" :
260
270
  f = match._0;
261
271
  exit = 3;
262
272
  break;
@@ -265,18 +275,18 @@ function fromUntagged(untagged, _shape, self) {
265
275
  }
266
276
  }
267
277
  break;
268
- case /* Self */7 :
278
+ case "Self" :
269
279
  _shape = self;
270
280
  continue ;
271
281
 
272
282
  }
273
283
  } else {
274
- switch (shape.TAG | 0) {
275
- case /* Literal */0 :
276
- if (typeof match === "number") {
284
+ switch (shape.TAG) {
285
+ case "Literal" :
286
+ if (typeof match !== "object") {
277
287
  exit = 1;
278
288
  } else {
279
- if (match.TAG === /* JSONString */0) {
289
+ if (match.TAG === "JSONString") {
280
290
  var text = match._0;
281
291
  var expected = shape._0;
282
292
  if (text === expected) {
@@ -284,18 +294,18 @@ function fromUntagged(untagged, _shape, self) {
284
294
  }
285
295
  throw {
286
296
  RE_EXN_ID: $$TypeError,
287
- _1: "Expecting literal " + expected + ", got " + text + "",
297
+ _1: "Expecting literal " + expected + ", got " + text,
288
298
  Error: new Error()
289
299
  };
290
300
  }
291
301
  exit = 1;
292
302
  }
293
303
  break;
294
- case /* Array */1 :
295
- if (typeof match === "number") {
304
+ case "Array" :
305
+ if (typeof match !== "object") {
296
306
  exit = 1;
297
307
  } else {
298
- if (match.TAG === /* JSONArray */3) {
308
+ if (match.TAG === "JSONArray") {
299
309
  var shape$1 = shape._0;
300
310
  return Curry._2(Prelude.$$Array.map, match._0, (function(shape$1){
301
311
  return function (item) {
@@ -306,11 +316,11 @@ function fromUntagged(untagged, _shape, self) {
306
316
  exit = 1;
307
317
  }
308
318
  break;
309
- case /* Tuple */2 :
310
- if (typeof match === "number") {
319
+ case "Tuple" :
320
+ if (typeof match !== "object") {
311
321
  exit = 1;
312
322
  } else {
313
- if (match.TAG === /* JSONArray */3) {
323
+ if (match.TAG === "JSONArray") {
314
324
  var items = match._0;
315
325
  var bases = shape._0;
316
326
  var lenbases = bases.length;
@@ -322,18 +332,18 @@ function fromUntagged(untagged, _shape, self) {
322
332
  }
323
333
  throw {
324
334
  RE_EXN_ID: $$TypeError,
325
- _1: "Expecting " + String(lenbases) + " items, got " + String(lenitems) + "",
335
+ _1: "Expecting " + String(lenbases) + " items, got " + String(lenitems),
326
336
  Error: new Error()
327
337
  };
328
338
  }
329
339
  exit = 1;
330
340
  }
331
341
  break;
332
- case /* Object */3 :
333
- if (typeof match === "number") {
342
+ case "Object" :
343
+ if (typeof match !== "object") {
334
344
  exit = 1;
335
345
  } else {
336
- if (match.TAG === /* JSONObject */2) {
346
+ if (match.TAG === "JSONObject") {
337
347
  var values = match._0;
338
348
  return Curry._1(Prelude.Dict.fromArray, Curry._2(Prelude.$$Array.map, shape._0, (function(values){
339
349
  return function (param) {
@@ -347,7 +357,7 @@ function fromUntagged(untagged, _shape, self) {
347
357
  if (msg.RE_EXN_ID === $$TypeError) {
348
358
  throw {
349
359
  RE_EXN_ID: $$TypeError,
350
- _1: "Field \"" + field + "\": " + msg._1 + "",
360
+ _1: "Field \"" + field + "\": " + msg._1,
351
361
  Error: new Error()
352
362
  };
353
363
  }
@@ -363,33 +373,35 @@ function fromUntagged(untagged, _shape, self) {
363
373
  exit = 1;
364
374
  }
365
375
  break;
366
- case /* Optional */4 :
376
+ case "Optional" :
367
377
  var shape$2 = shape._0;
368
- if (typeof match === "number") {
369
- if (match >= 2) {
378
+ if (typeof match !== "object") {
379
+ if (match === "JSONNull") {
370
380
  return undefined;
371
381
  }
372
382
  _shape = shape$2;
373
383
  continue ;
384
+ } else {
385
+ _shape = shape$2;
386
+ continue ;
374
387
  }
375
- _shape = shape$2;
376
- continue ;
377
- case /* OptionalWithDefault */5 :
388
+ case "OptionalWithDefault" :
378
389
  var shape$3 = shape._0;
379
- if (typeof match === "number") {
380
- if (match >= 2) {
390
+ if (typeof match !== "object") {
391
+ if (match === "JSONNull") {
381
392
  return shape._1;
382
393
  }
383
394
  _shape = shape$3;
384
395
  continue ;
396
+ } else {
397
+ _shape = shape$3;
398
+ continue ;
385
399
  }
386
- _shape = shape$3;
387
- continue ;
388
- case /* Mapping */6 :
389
- if (typeof match === "number") {
400
+ case "Mapping" :
401
+ if (typeof match !== "object") {
390
402
  exit = 1;
391
403
  } else {
392
- if (match.TAG === /* JSONObject */2) {
404
+ if (match.TAG === "JSONObject") {
393
405
  var f$1 = shape._0;
394
406
  return Prelude.Dict.mapValues(match._0, (function(f$1){
395
407
  return function (v) {
@@ -400,9 +412,9 @@ function fromUntagged(untagged, _shape, self) {
400
412
  exit = 1;
401
413
  }
402
414
  break;
403
- case /* Deserializer */7 :
404
- var res = Curry._1(shape._0.fromJSON, untagged);
405
- if (res.TAG === /* Ok */0) {
415
+ case "Deserializer" :
416
+ var res = shape._0.fromJSON(untagged);
417
+ if (res.TAG === "Ok") {
406
418
  return res._0;
407
419
  }
408
420
  throw {
@@ -410,11 +422,11 @@ function fromUntagged(untagged, _shape, self) {
410
422
  _1: res._0,
411
423
  Error: new Error()
412
424
  };
413
- case /* Collection */8 :
414
- if (typeof match === "number") {
425
+ case "Collection" :
426
+ if (typeof match !== "object") {
415
427
  exit = 1;
416
428
  } else {
417
- if (match.TAG === /* JSONArray */3) {
429
+ if (match.TAG === "JSONArray") {
418
430
  return Curry._2(Prelude.$$Array.map, Prelude.$$Array.keepSome(Curry._2(Prelude.$$Array.map, Curry._2(Prelude.$$Array.map, match._0, shape._0.fromJSON), Prelude.Result.warn)), (function (prim) {
419
431
  return prim;
420
432
  }));
@@ -422,7 +434,7 @@ function fromUntagged(untagged, _shape, self) {
422
434
  exit = 1;
423
435
  }
424
436
  break;
425
- case /* DefaultWhenInvalid */9 :
437
+ case "DefaultWhenInvalid" :
426
438
  try {
427
439
  return fromUntagged(untagged, shape._0, self);
428
440
  }
@@ -434,8 +446,8 @@ function fromUntagged(untagged, _shape, self) {
434
446
  }
435
447
  throw msg;
436
448
  }
437
- case /* Morphism */10 :
438
- return Curry._1(shape._1, fromUntagged(untagged, shape._0, self));
449
+ case "Morphism" :
450
+ return shape._1(fromUntagged(untagged, shape._0, self));
439
451
 
440
452
  }
441
453
  }
@@ -451,7 +463,7 @@ function fromUntagged(untagged, _shape, self) {
451
463
  if (Number.isNaN(r.getDate())) {
452
464
  throw {
453
465
  RE_EXN_ID: $$TypeError,
454
- _1: "Invalid date " + s + "",
466
+ _1: "Invalid date " + s,
455
467
  Error: new Error()
456
468
  };
457
469
  }
@@ -461,7 +473,7 @@ function fromUntagged(untagged, _shape, self) {
461
473
  if (Number.isNaN(r$1.getDate())) {
462
474
  throw {
463
475
  RE_EXN_ID: $$TypeError,
464
- _1: "Invalid date " + f.toString() + "",
476
+ _1: "Invalid date " + f.toString(),
465
477
  Error: new Error()
466
478
  };
467
479
  }
@@ -476,74 +488,80 @@ function checkFieldsSanity(name, _fields, _optional) {
476
488
  var optional = _optional;
477
489
  var fields = _fields;
478
490
  var exit = 0;
479
- if (typeof fields === "number") {
491
+ if (typeof fields !== "object") {
480
492
  switch (fields) {
481
- case /* Any */0 :
482
- case /* Boolean */4 :
483
- case /* Date */5 :
484
- case /* Datetime */6 :
493
+ case "Any" :
494
+ case "Boolean" :
495
+ case "Date" :
496
+ case "Datetime" :
485
497
  return {
486
- TAG: /* Ok */0,
498
+ TAG: "Ok",
487
499
  _0: undefined
488
500
  };
489
- case /* Self */7 :
501
+ case "Self" :
490
502
  if (optional) {
491
503
  return {
492
- TAG: /* Ok */0,
504
+ TAG: "Ok",
493
505
  _0: undefined
494
506
  };
495
507
  } else {
496
508
  return {
497
- TAG: /* Error */1,
498
- _0: "" + name + ": Trivial infinite recursion 'let fields = Self'"
509
+ TAG: "Error",
510
+ _0: name + ": Trivial infinite recursion 'let fields = Self'"
499
511
  };
500
512
  }
501
513
  default:
502
514
  return {
503
- TAG: /* Ok */0,
515
+ TAG: "Ok",
504
516
  _0: undefined
505
517
  };
506
518
  }
507
519
  } else {
508
- switch (fields.TAG | 0) {
509
- case /* Tuple */2 :
520
+ switch (fields.TAG) {
521
+ case "Tuple" :
510
522
  return Curry._2(Prelude.ManyResults.map, Prelude.ManyResults.bailU(Curry._2(Prelude.$$Array.mapWithIndex, fields._0, (function(optional){
511
- return function (index, field, param) {
512
- return checkFieldsSanity("" + name + "[" + String(index) + "]", field, optional);
523
+ return function (index, field) {
524
+ return function () {
525
+ return checkFieldsSanity(name + "[" + String(index) + "]", field, optional);
526
+ };
513
527
  }
514
528
  }(optional)))), (function (param) {
515
529
 
516
530
  }));
517
- case /* Object */3 :
531
+ case "Object" :
518
532
  return Curry._2(Prelude.ManyResults.map, Prelude.ManyResults.bailU(Curry._2(Prelude.$$Array.map, fields._0, (function(optional){
519
- return function (param, param$1) {
520
- return checkFieldsSanity("" + name + "::" + param[0] + "", param[1], optional);
533
+ return function (param) {
534
+ var field = param[1];
535
+ var fieldName = param[0];
536
+ return function () {
537
+ return checkFieldsSanity(name + "::" + fieldName, field, optional);
538
+ };
521
539
  }
522
540
  }(optional)))), (function (param) {
523
541
 
524
542
  }));
525
- case /* Array */1 :
526
- case /* Mapping */6 :
543
+ case "Array" :
544
+ case "Mapping" :
527
545
  _optional = true;
528
546
  _fields = fields._0;
529
547
  continue ;
530
- case /* Deserializer */7 :
531
- case /* Collection */8 :
548
+ case "Deserializer" :
549
+ case "Collection" :
532
550
  exit = 2;
533
551
  break;
534
- case /* Optional */4 :
535
- case /* OptionalWithDefault */5 :
536
- case /* DefaultWhenInvalid */9 :
552
+ case "Optional" :
553
+ case "OptionalWithDefault" :
554
+ case "DefaultWhenInvalid" :
537
555
  exit = 1;
538
556
  break;
539
- case /* Morphism */10 :
557
+ case "Morphism" :
540
558
  return {
541
- TAG: /* Ok */0,
559
+ TAG: "Ok",
542
560
  _0: undefined
543
561
  };
544
562
  default:
545
563
  return {
546
- TAG: /* Ok */0,
564
+ TAG: "Ok",
547
565
  _0: undefined
548
566
  };
549
567
  }
@@ -554,16 +572,16 @@ function checkFieldsSanity(name, _fields, _optional) {
554
572
  _fields = fields._0;
555
573
  continue ;
556
574
  case 2 :
557
- var msg = Curry._1(fields._0.checkFieldsSanity, undefined);
558
- if (msg.TAG === /* Ok */0) {
575
+ var msg = fields._0.checkFieldsSanity(undefined);
576
+ if (msg.TAG === "Ok") {
559
577
  return {
560
- TAG: /* Ok */0,
578
+ TAG: "Ok",
561
579
  _0: undefined
562
580
  };
563
581
  } else {
564
582
  return {
565
- TAG: /* Error */1,
566
- _0: "" + name + "/ " + msg._0 + ""
583
+ TAG: "Error",
584
+ _0: name + "/ " + msg._0
567
585
  };
568
586
  }
569
587
 
@@ -589,8 +607,8 @@ var Field = {
589
607
 
590
608
  function MakeDeserializer(S) {
591
609
  var fields = S.fields;
592
- var name = "Deserializer " + "JSON" + ", " + "File \"JSON.res\", line 321, characters 39-47" + "";
593
- var checkFieldsSanity$1 = function (param) {
610
+ var name = "Deserializer " + "JSON" + ", " + "File \"JSON.res\", line 319, characters 39-47";
611
+ var checkFieldsSanity$1 = function () {
594
612
  return checkFieldsSanity(name, fields, false);
595
613
  };
596
614
  var fromJSON = function (json) {
@@ -602,14 +620,14 @@ function MakeDeserializer(S) {
602
620
  var e = Caml_js_exceptions.internalToOCamlException(raw_e);
603
621
  if (e.RE_EXN_ID === $$TypeError) {
604
622
  return {
605
- TAG: /* Error */1,
623
+ TAG: "Error",
606
624
  _0: e._1
607
625
  };
608
626
  }
609
627
  throw e;
610
628
  }
611
629
  return {
612
- TAG: /* Ok */0,
630
+ TAG: "Ok",
613
631
  _0: res
614
632
  };
615
633
  };