decoders 1.25.5 → 2.0.0-beta10
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.
- package/CHANGELOG.md +53 -3
- package/Decoder.d.ts +27 -0
- package/Decoder.js +199 -0
- package/Decoder.js.flow +224 -0
- package/Decoder.mjs +192 -0
- package/NotSupportedTSVersion.d.ts +1 -0
- package/README.md +105 -961
- package/_utils.d.ts +9 -0
- package/_utils.js +102 -0
- package/_utils.js.flow +93 -0
- package/_utils.mjs +89 -0
- package/annotate.d.ts +62 -0
- package/annotate.js +161 -0
- package/annotate.js.flow +218 -0
- package/annotate.mjs +144 -0
- package/format.d.ts +4 -0
- package/format.js +151 -0
- package/format.js.flow +126 -0
- package/format.mjs +140 -0
- package/index.d.ts +38 -36
- package/index.js +69 -376
- package/index.js.flow +39 -51
- package/index.mjs +11 -0
- package/{helpers.d.ts → lib/_helpers.d.ts} +0 -0
- package/lib/arrays.d.ts +37 -0
- package/lib/arrays.js +138 -0
- package/lib/arrays.js.flow +138 -0
- package/lib/arrays.mjs +123 -0
- package/lib/basics.d.ts +14 -0
- package/lib/basics.js +109 -0
- package/lib/basics.js.flow +85 -0
- package/lib/basics.mjs +85 -0
- package/{boolean.d.ts → lib/booleans.d.ts} +1 -1
- package/lib/booleans.js +35 -0
- package/lib/booleans.js.flow +22 -0
- package/lib/booleans.mjs +25 -0
- package/{date.d.ts → lib/dates.d.ts} +1 -1
- package/lib/dates.js +44 -0
- package/lib/dates.js.flow +40 -0
- package/lib/dates.mjs +34 -0
- package/{json.d.ts → lib/json.d.ts} +1 -1
- package/lib/json.js +55 -0
- package/lib/json.js.flow +50 -0
- package/lib/json.mjs +40 -0
- package/{number.d.ts → lib/numbers.d.ts} +2 -1
- package/lib/numbers.js +52 -0
- package/lib/numbers.js.flow +49 -0
- package/lib/numbers.mjs +42 -0
- package/{object.d.ts → lib/objects.d.ts} +11 -6
- package/lib/objects.js +240 -0
- package/lib/objects.js.flow +246 -0
- package/lib/objects.mjs +223 -0
- package/lib/strings.d.ts +13 -0
- package/lib/strings.js +101 -0
- package/lib/strings.js.flow +90 -0
- package/lib/strings.mjs +82 -0
- package/lib/unions.d.ts +78 -0
- package/lib/unions.js +161 -0
- package/lib/unions.js.flow +158 -0
- package/lib/unions.mjs +145 -0
- package/lib/utilities.d.ts +10 -0
- package/lib/utilities.js +94 -0
- package/lib/utilities.js.flow +84 -0
- package/lib/utilities.mjs +79 -0
- package/package.json +78 -23
- package/result.d.ts +16 -0
- package/result.js +34 -0
- package/result.js.flow +26 -0
- package/result.mjs +27 -0
- package/array.d.ts +0 -5
- package/array.js +0 -133
- package/array.js.flow +0 -106
- package/boolean.js +0 -42
- package/boolean.js.flow +0 -28
- package/constants.d.ts +0 -11
- package/constants.js +0 -67
- package/constants.js.flow +0 -45
- package/date.js +0 -42
- package/date.js.flow +0 -38
- package/describe.d.ts +0 -3
- package/describe.js +0 -22
- package/describe.js.flow +0 -17
- package/dispatch.d.ts +0 -8
- package/dispatch.js +0 -58
- package/dispatch.js.flow +0 -57
- package/either.d.ts +0 -61
- package/either.js +0 -85
- package/either.js.flow +0 -131
- package/fail.d.ts +0 -3
- package/fail.js +0 -19
- package/fail.js.flow +0 -13
- package/guard.d.ts +0 -7
- package/guard.js +0 -30
- package/guard.js.flow +0 -36
- package/instanceOf.d.ts +0 -3
- package/instanceOf.js +0 -17
- package/instanceOf.js.flow +0 -21
- package/json.js +0 -33
- package/json.js.flow +0 -28
- package/lazy.d.ts +0 -3
- package/lazy.js +0 -18
- package/lazy.js.flow +0 -15
- package/mapping.d.ts +0 -4
- package/mapping.js +0 -113
- package/mapping.js.flow +0 -71
- package/number.js +0 -38
- package/number.js.flow +0 -35
- package/object.js +0 -254
- package/object.js.flow +0 -211
- package/optional.d.ts +0 -5
- package/optional.js +0 -52
- package/optional.js.flow +0 -42
- package/string.d.ts +0 -7
- package/string.js +0 -93
- package/string.js.flow +0 -81
- package/tuple.d.ts +0 -30
- package/tuple.js +0 -199
- package/tuple.js.flow +0 -221
- package/types.d.ts +0 -18
- package/types.js +0 -5
- package/types.js.flow +0 -26
- package/utils.d.ts +0 -13
- package/utils.js +0 -70
- package/utils.js.flow +0 -58
package/format.mjs
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { summarize as _summarize, asDate, INDENT, indent, isMultiline } from './_utils.mjs';
|
|
2
|
+
|
|
3
|
+
function serializeString(s, width) {
|
|
4
|
+
if (width === void 0) {
|
|
5
|
+
width = 80;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Full string
|
|
9
|
+
// Abbreviated to $maxlen i.e. "Vincent Driess..." [truncated]
|
|
10
|
+
var ser = JSON.stringify(s);
|
|
11
|
+
|
|
12
|
+
if (ser.length <= width) {
|
|
13
|
+
return ser;
|
|
14
|
+
} // Cut off a bit
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var truncated = s.substring(0, width - 15) + '...';
|
|
18
|
+
ser = JSON.stringify(truncated) + ' [truncated]';
|
|
19
|
+
return ser;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function serializeArray(annotation, prefix) {
|
|
23
|
+
var items = annotation.items;
|
|
24
|
+
|
|
25
|
+
if (items.length === 0) {
|
|
26
|
+
return '[]';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var result = [];
|
|
30
|
+
items.forEach(function (item) {
|
|
31
|
+
var _serializeAnnotation = serializeAnnotation(item, prefix + INDENT),
|
|
32
|
+
ser = _serializeAnnotation[0],
|
|
33
|
+
ann = _serializeAnnotation[1];
|
|
34
|
+
|
|
35
|
+
result.push(prefix + INDENT + ser + ',');
|
|
36
|
+
|
|
37
|
+
if (ann !== undefined) {
|
|
38
|
+
result.push(indent(ann, prefix + INDENT));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return ['['].concat(result, [prefix + ']']).join('\n');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function serializeObject(annotation, prefix) {
|
|
45
|
+
var fields = annotation.fields;
|
|
46
|
+
var fieldNames = Object.keys(fields);
|
|
47
|
+
|
|
48
|
+
if (fieldNames.length === 0) {
|
|
49
|
+
return '{}';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
var result = [];
|
|
53
|
+
fieldNames.forEach(function (key) {
|
|
54
|
+
var valueAnnotation = fields[key];
|
|
55
|
+
var kser = serializeValue(key);
|
|
56
|
+
var valPrefix = prefix + INDENT + ' '.repeat(kser.length + 2);
|
|
57
|
+
|
|
58
|
+
var _serializeAnnotation2 = serializeAnnotation(valueAnnotation, prefix + INDENT),
|
|
59
|
+
vser = _serializeAnnotation2[0],
|
|
60
|
+
vann = _serializeAnnotation2[1];
|
|
61
|
+
|
|
62
|
+
result.push(prefix + INDENT + kser + ': ' + vser + ',');
|
|
63
|
+
|
|
64
|
+
if (vann !== undefined) {
|
|
65
|
+
result.push(indent(vann, valPrefix));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
return ['{'].concat(result, [prefix + '}']).join('\n');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function serializeValue(value) {
|
|
72
|
+
// istanbul ignore else
|
|
73
|
+
if (typeof value === 'string') {
|
|
74
|
+
return serializeString(value);
|
|
75
|
+
} else if (typeof value === 'number' || typeof value === 'boolean') {
|
|
76
|
+
return value.toString();
|
|
77
|
+
} else if (value === null) {
|
|
78
|
+
return 'null';
|
|
79
|
+
} else if (value === undefined) {
|
|
80
|
+
return 'undefined';
|
|
81
|
+
} else {
|
|
82
|
+
var valueAsDate = asDate(value);
|
|
83
|
+
|
|
84
|
+
if (valueAsDate !== null) {
|
|
85
|
+
return "new Date(" + JSON.stringify(valueAsDate.toISOString()) + ")";
|
|
86
|
+
} else if (value instanceof Date) {
|
|
87
|
+
// NOTE: Using `instanceof Date` is unreliable way of checking dates.
|
|
88
|
+
// If this case occurs (and it didn't pass the prior asDate())
|
|
89
|
+
// check, then this must be the case where it's an invalid date.
|
|
90
|
+
return '(Invalid Date)';
|
|
91
|
+
} else {
|
|
92
|
+
return '(unserializable)';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export function serializeAnnotation(ann, prefix) {
|
|
97
|
+
if (prefix === void 0) {
|
|
98
|
+
prefix = '';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// The serialized data (the input object echoed back)
|
|
102
|
+
var serialized;
|
|
103
|
+
|
|
104
|
+
if (ann.type === 'array') {
|
|
105
|
+
serialized = serializeArray(ann, prefix);
|
|
106
|
+
} else if (ann.type === 'object') {
|
|
107
|
+
serialized = serializeObject(ann, prefix);
|
|
108
|
+
} else if (ann.type === 'function') {
|
|
109
|
+
serialized = '<function>';
|
|
110
|
+
} else if (ann.type === 'circular-ref') {
|
|
111
|
+
serialized = '<circular ref>';
|
|
112
|
+
} else if (ann.type === 'unknown') {
|
|
113
|
+
serialized = '???';
|
|
114
|
+
} else {
|
|
115
|
+
serialized = serializeValue(ann.value);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
var text = ann.text;
|
|
119
|
+
|
|
120
|
+
if (text !== undefined) {
|
|
121
|
+
var sep = '^'.repeat(isMultiline(serialized) ? 1 : serialized.length);
|
|
122
|
+
return [serialized, [sep, text].join(isMultiline(text) ? '\n' : ' ')];
|
|
123
|
+
} else {
|
|
124
|
+
return [serialized, undefined];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export function formatInline(ann) {
|
|
128
|
+
var _serializeAnnotation3 = serializeAnnotation(ann),
|
|
129
|
+
serialized = _serializeAnnotation3[0],
|
|
130
|
+
annotation = _serializeAnnotation3[1];
|
|
131
|
+
|
|
132
|
+
if (annotation !== undefined) {
|
|
133
|
+
return serialized + '\n' + annotation;
|
|
134
|
+
} else {
|
|
135
|
+
return serialized;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export function formatShort(ann) {
|
|
139
|
+
return _summarize(ann, []).join('\n');
|
|
140
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
export { DecodeResult, Decoder, DecoderType, Scalar, define } from './Decoder';
|
|
2
|
+
export { JSONValue, JSONObject, JSONArray } from './lib/json';
|
|
2
3
|
|
|
3
|
-
export { guard } from './guard';
|
|
4
|
-
export { compose, map, predicate } from './utils';
|
|
5
|
-
|
|
6
|
-
export { array, nonEmptyArray, poja } from './array';
|
|
7
|
-
export { boolean, numericBoolean, truthy } from './boolean';
|
|
8
|
-
export { constant, hardcoded, mixed, null_, undefined_, unknown } from './constants';
|
|
9
|
-
export { date, iso8601 } from './date';
|
|
10
|
-
export { describe } from './describe';
|
|
11
|
-
export { dispatch } from './dispatch';
|
|
12
4
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export { mapping,
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
5
|
+
always,
|
|
6
|
+
constant,
|
|
7
|
+
hardcoded,
|
|
8
|
+
maybe,
|
|
9
|
+
mixed,
|
|
10
|
+
nullable,
|
|
11
|
+
null_,
|
|
12
|
+
optional,
|
|
13
|
+
undefined_,
|
|
14
|
+
unknown,
|
|
15
|
+
} from './lib/basics';
|
|
16
|
+
export { array, nonEmptyArray, poja, set, tuple } from './lib/arrays';
|
|
17
|
+
export { boolean, numericBoolean, truthy } from './lib/booleans';
|
|
18
|
+
export { date, iso8601 } from './lib/dates';
|
|
19
|
+
export { dict, exact, inexact, mapping, object, pojo } from './lib/objects';
|
|
20
|
+
export { either, oneOf, taggedUnion, dispatch } from './lib/unions';
|
|
21
|
+
export {
|
|
22
|
+
email,
|
|
23
|
+
httpsUrl,
|
|
24
|
+
nonEmptyString,
|
|
25
|
+
regex,
|
|
26
|
+
string,
|
|
27
|
+
url,
|
|
28
|
+
uuid,
|
|
29
|
+
uuidv1,
|
|
30
|
+
uuidv4,
|
|
31
|
+
} from './lib/strings';
|
|
32
|
+
export { fail, instanceOf, lazy, never, prep } from './lib/utilities';
|
|
33
|
+
export {
|
|
34
|
+
anyNumber,
|
|
35
|
+
integer,
|
|
36
|
+
number,
|
|
37
|
+
positiveInteger,
|
|
38
|
+
positiveNumber,
|
|
39
|
+
} from './lib/numbers';
|
|
40
|
+
export { json, jsonObject, jsonArray } from './lib/json';
|
package/index.js
CHANGED
|
@@ -1,397 +1,90 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "array", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _array.array;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "boolean", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _boolean["boolean"];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "compose", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _utils.compose;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "constant", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _constants.constant;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "date", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _date.date;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "describe", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function get() {
|
|
39
|
-
return _describe.describe;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "dict", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function get() {
|
|
45
|
-
return _mapping.dict;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "dispatch", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function get() {
|
|
51
|
-
return _dispatch.dispatch;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "either", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function get() {
|
|
57
|
-
return _either.either;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "either3", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function get() {
|
|
63
|
-
return _either.either3;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "either4", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function get() {
|
|
69
|
-
return _either.either4;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "either5", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function get() {
|
|
75
|
-
return _either.either5;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, "either6", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function get() {
|
|
81
|
-
return _either.either6;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "either7", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function get() {
|
|
87
|
-
return _either.either7;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, "either8", {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function get() {
|
|
93
|
-
return _either.either8;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, "either9", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function get() {
|
|
99
|
-
return _either.either9;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, "email", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function get() {
|
|
105
|
-
return _string.email;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, "exact", {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function get() {
|
|
111
|
-
return _object.exact;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, "fail", {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function get() {
|
|
117
|
-
return _fail.fail;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
Object.defineProperty(exports, "guard", {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function get() {
|
|
123
|
-
return _guard.guard;
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(exports, "hardcoded", {
|
|
127
|
-
enumerable: true,
|
|
128
|
-
get: function get() {
|
|
129
|
-
return _constants.hardcoded;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
Object.defineProperty(exports, "inexact", {
|
|
133
|
-
enumerable: true,
|
|
134
|
-
get: function get() {
|
|
135
|
-
return _object.inexact;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
Object.defineProperty(exports, "instanceOf", {
|
|
139
|
-
enumerable: true,
|
|
140
|
-
get: function get() {
|
|
141
|
-
return _instanceOf.instanceOf;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
Object.defineProperty(exports, "integer", {
|
|
145
|
-
enumerable: true,
|
|
146
|
-
get: function get() {
|
|
147
|
-
return _number.integer;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
Object.defineProperty(exports, "iso8601", {
|
|
151
|
-
enumerable: true,
|
|
152
|
-
get: function get() {
|
|
153
|
-
return _date.iso8601;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
Object.defineProperty(exports, "json", {
|
|
157
|
-
enumerable: true,
|
|
158
|
-
get: function get() {
|
|
159
|
-
return _json.json;
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
Object.defineProperty(exports, "jsonArray", {
|
|
163
|
-
enumerable: true,
|
|
164
|
-
get: function get() {
|
|
165
|
-
return _json.jsonArray;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(exports, "jsonObject", {
|
|
169
|
-
enumerable: true,
|
|
170
|
-
get: function get() {
|
|
171
|
-
return _json.jsonObject;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
Object.defineProperty(exports, "lazy", {
|
|
175
|
-
enumerable: true,
|
|
176
|
-
get: function get() {
|
|
177
|
-
return _lazy.lazy;
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
Object.defineProperty(exports, "map", {
|
|
181
|
-
enumerable: true,
|
|
182
|
-
get: function get() {
|
|
183
|
-
return _utils.map;
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
Object.defineProperty(exports, "mapping", {
|
|
187
|
-
enumerable: true,
|
|
188
|
-
get: function get() {
|
|
189
|
-
return _mapping.mapping;
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
Object.defineProperty(exports, "maybe", {
|
|
193
|
-
enumerable: true,
|
|
194
|
-
get: function get() {
|
|
195
|
-
return _optional.maybe;
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
Object.defineProperty(exports, "mixed", {
|
|
199
|
-
enumerable: true,
|
|
200
|
-
get: function get() {
|
|
201
|
-
return _constants.mixed;
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
Object.defineProperty(exports, "nonEmptyArray", {
|
|
205
|
-
enumerable: true,
|
|
206
|
-
get: function get() {
|
|
207
|
-
return _array.nonEmptyArray;
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
Object.defineProperty(exports, "nonEmptyString", {
|
|
211
|
-
enumerable: true,
|
|
212
|
-
get: function get() {
|
|
213
|
-
return _string.nonEmptyString;
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
Object.defineProperty(exports, "null_", {
|
|
217
|
-
enumerable: true,
|
|
218
|
-
get: function get() {
|
|
219
|
-
return _constants.null_;
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
Object.defineProperty(exports, "nullable", {
|
|
223
|
-
enumerable: true,
|
|
224
|
-
get: function get() {
|
|
225
|
-
return _optional.nullable;
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
Object.defineProperty(exports, "number", {
|
|
229
|
-
enumerable: true,
|
|
230
|
-
get: function get() {
|
|
231
|
-
return _number.number;
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
Object.defineProperty(exports, "numericBoolean", {
|
|
235
|
-
enumerable: true,
|
|
236
|
-
get: function get() {
|
|
237
|
-
return _boolean.numericBoolean;
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
Object.defineProperty(exports, "object", {
|
|
241
|
-
enumerable: true,
|
|
242
|
-
get: function get() {
|
|
243
|
-
return _object.object;
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
Object.defineProperty(exports, "oneOf", {
|
|
247
|
-
enumerable: true,
|
|
248
|
-
get: function get() {
|
|
249
|
-
return _either.oneOf;
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
Object.defineProperty(exports, "optional", {
|
|
253
|
-
enumerable: true,
|
|
254
|
-
get: function get() {
|
|
255
|
-
return _optional.optional;
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
Object.defineProperty(exports, "poja", {
|
|
259
|
-
enumerable: true,
|
|
260
|
-
get: function get() {
|
|
261
|
-
return _array.poja;
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
Object.defineProperty(exports, "pojo", {
|
|
265
|
-
enumerable: true,
|
|
266
|
-
get: function get() {
|
|
267
|
-
return _object.pojo;
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
Object.defineProperty(exports, "positiveInteger", {
|
|
271
|
-
enumerable: true,
|
|
272
|
-
get: function get() {
|
|
273
|
-
return _number.positiveInteger;
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
Object.defineProperty(exports, "positiveNumber", {
|
|
277
|
-
enumerable: true,
|
|
278
|
-
get: function get() {
|
|
279
|
-
return _number.positiveNumber;
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
Object.defineProperty(exports, "predicate", {
|
|
283
|
-
enumerable: true,
|
|
284
|
-
get: function get() {
|
|
285
|
-
return _utils.predicate;
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
Object.defineProperty(exports, "regex", {
|
|
289
|
-
enumerable: true,
|
|
290
|
-
get: function get() {
|
|
291
|
-
return _string.regex;
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
Object.defineProperty(exports, "string", {
|
|
295
|
-
enumerable: true,
|
|
296
|
-
get: function get() {
|
|
297
|
-
return _string.string;
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
Object.defineProperty(exports, "truthy", {
|
|
301
|
-
enumerable: true,
|
|
302
|
-
get: function get() {
|
|
303
|
-
return _boolean.truthy;
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
Object.defineProperty(exports, "tuple1", {
|
|
307
|
-
enumerable: true,
|
|
308
|
-
get: function get() {
|
|
309
|
-
return _tuple.tuple1;
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
Object.defineProperty(exports, "tuple2", {
|
|
313
|
-
enumerable: true,
|
|
314
|
-
get: function get() {
|
|
315
|
-
return _tuple.tuple2;
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
Object.defineProperty(exports, "tuple3", {
|
|
319
|
-
enumerable: true,
|
|
320
|
-
get: function get() {
|
|
321
|
-
return _tuple.tuple3;
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
Object.defineProperty(exports, "tuple4", {
|
|
325
|
-
enumerable: true,
|
|
326
|
-
get: function get() {
|
|
327
|
-
return _tuple.tuple4;
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
Object.defineProperty(exports, "tuple5", {
|
|
331
|
-
enumerable: true,
|
|
332
|
-
get: function get() {
|
|
333
|
-
return _tuple.tuple5;
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
Object.defineProperty(exports, "tuple6", {
|
|
337
|
-
enumerable: true,
|
|
338
|
-
get: function get() {
|
|
339
|
-
return _tuple.tuple6;
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
Object.defineProperty(exports, "undefined_", {
|
|
343
|
-
enumerable: true,
|
|
344
|
-
get: function get() {
|
|
345
|
-
return _constants.undefined_;
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
Object.defineProperty(exports, "unknown", {
|
|
349
|
-
enumerable: true,
|
|
350
|
-
get: function get() {
|
|
351
|
-
return _constants.unknown;
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
Object.defineProperty(exports, "url", {
|
|
355
|
-
enumerable: true,
|
|
356
|
-
get: function get() {
|
|
357
|
-
return _string.url;
|
|
358
|
-
}
|
|
359
|
-
});
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.uuidv4 = exports.uuidv1 = exports.uuid = exports.url = exports.unknown = exports.undefined_ = exports.tuple = exports.truthy = exports.taggedUnion = exports.string = exports.set = exports.regex = exports.prep = exports.positiveNumber = exports.positiveInteger = exports.pojo = exports.poja = exports.optional = exports.oneOf = exports.object = exports.numericBoolean = exports.number = exports.nullable = exports.null_ = exports.nonEmptyString = exports.nonEmptyArray = exports.never = exports.mixed = exports.maybe = exports.mapping = exports.lazy = exports.jsonObject = exports.jsonArray = exports.json = exports.iso8601 = exports.integer = exports.instanceOf = exports.inexact = exports.httpsUrl = exports.hardcoded = exports.fail = exports.exact = exports.email = exports.either = exports.dispatch = exports.dict = exports.define = exports.date = exports.constant = exports["boolean"] = exports.array = exports.anyNumber = exports.always = void 0;
|
|
360
5
|
|
|
361
|
-
var
|
|
6
|
+
var _Decoder = require("./Decoder");
|
|
362
7
|
|
|
363
|
-
|
|
8
|
+
exports.define = _Decoder.define;
|
|
364
9
|
|
|
365
|
-
var
|
|
10
|
+
var _basics = require("./lib/basics");
|
|
366
11
|
|
|
367
|
-
|
|
12
|
+
exports.always = _basics.always;
|
|
13
|
+
exports.constant = _basics.constant;
|
|
14
|
+
exports.hardcoded = _basics.hardcoded;
|
|
15
|
+
exports.maybe = _basics.maybe;
|
|
16
|
+
exports.mixed = _basics.mixed;
|
|
17
|
+
exports.nullable = _basics.nullable;
|
|
18
|
+
exports.null_ = _basics.null_;
|
|
19
|
+
exports.optional = _basics.optional;
|
|
20
|
+
exports.undefined_ = _basics.undefined_;
|
|
21
|
+
exports.unknown = _basics.unknown;
|
|
368
22
|
|
|
369
|
-
var
|
|
23
|
+
var _arrays = require("./lib/arrays");
|
|
370
24
|
|
|
371
|
-
|
|
25
|
+
exports.array = _arrays.array;
|
|
26
|
+
exports.nonEmptyArray = _arrays.nonEmptyArray;
|
|
27
|
+
exports.poja = _arrays.poja;
|
|
28
|
+
exports.set = _arrays.set;
|
|
29
|
+
exports.tuple = _arrays.tuple;
|
|
372
30
|
|
|
373
|
-
var
|
|
31
|
+
var _booleans = require("./lib/booleans");
|
|
374
32
|
|
|
375
|
-
|
|
33
|
+
exports["boolean"] = _booleans["boolean"];
|
|
34
|
+
exports.numericBoolean = _booleans.numericBoolean;
|
|
35
|
+
exports.truthy = _booleans.truthy;
|
|
376
36
|
|
|
377
|
-
var
|
|
37
|
+
var _dates = require("./lib/dates");
|
|
378
38
|
|
|
379
|
-
|
|
39
|
+
exports.date = _dates.date;
|
|
40
|
+
exports.iso8601 = _dates.iso8601;
|
|
380
41
|
|
|
381
|
-
var
|
|
42
|
+
var _objects = require("./lib/objects");
|
|
382
43
|
|
|
383
|
-
|
|
44
|
+
exports.dict = _objects.dict;
|
|
45
|
+
exports.exact = _objects.exact;
|
|
46
|
+
exports.inexact = _objects.inexact;
|
|
47
|
+
exports.mapping = _objects.mapping;
|
|
48
|
+
exports.object = _objects.object;
|
|
49
|
+
exports.pojo = _objects.pojo;
|
|
384
50
|
|
|
385
|
-
var
|
|
51
|
+
var _unions = require("./lib/unions");
|
|
386
52
|
|
|
387
|
-
|
|
53
|
+
exports.either = _unions.either;
|
|
54
|
+
exports.oneOf = _unions.oneOf;
|
|
55
|
+
exports.taggedUnion = _unions.taggedUnion;
|
|
56
|
+
exports.dispatch = _unions.dispatch;
|
|
388
57
|
|
|
389
|
-
var
|
|
58
|
+
var _strings = require("./lib/strings");
|
|
390
59
|
|
|
391
|
-
|
|
60
|
+
exports.email = _strings.email;
|
|
61
|
+
exports.httpsUrl = _strings.httpsUrl;
|
|
62
|
+
exports.nonEmptyString = _strings.nonEmptyString;
|
|
63
|
+
exports.regex = _strings.regex;
|
|
64
|
+
exports.string = _strings.string;
|
|
65
|
+
exports.url = _strings.url;
|
|
66
|
+
exports.uuid = _strings.uuid;
|
|
67
|
+
exports.uuidv1 = _strings.uuidv1;
|
|
68
|
+
exports.uuidv4 = _strings.uuidv4;
|
|
392
69
|
|
|
393
|
-
var
|
|
70
|
+
var _utilities = require("./lib/utilities");
|
|
394
71
|
|
|
395
|
-
|
|
72
|
+
exports.fail = _utilities.fail;
|
|
73
|
+
exports.instanceOf = _utilities.instanceOf;
|
|
74
|
+
exports.lazy = _utilities.lazy;
|
|
75
|
+
exports.never = _utilities.never;
|
|
76
|
+
exports.prep = _utilities.prep;
|
|
396
77
|
|
|
397
|
-
var
|
|
78
|
+
var _numbers = require("./lib/numbers");
|
|
79
|
+
|
|
80
|
+
exports.anyNumber = _numbers.anyNumber;
|
|
81
|
+
exports.integer = _numbers.integer;
|
|
82
|
+
exports.number = _numbers.number;
|
|
83
|
+
exports.positiveInteger = _numbers.positiveInteger;
|
|
84
|
+
exports.positiveNumber = _numbers.positiveNumber;
|
|
85
|
+
|
|
86
|
+
var _json = require("./lib/json");
|
|
87
|
+
|
|
88
|
+
exports.json = _json.json;
|
|
89
|
+
exports.jsonObject = _json.jsonObject;
|
|
90
|
+
exports.jsonArray = _json.jsonArray;
|