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