@@ -45,7 +45,7 @@ for name in DECODER_METHODS:
45
45
]]]-->
46
46
---
47
47
48
- <a href =" #verify " >#</a > ** .verify** (blob: <i style =" color : #267f99 " >mixed</i >): <i style =" color : #267f99 " >T</i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L179-L191 ' Source ')
48
+ <a href =" #verify " >#</a > ** .verify** (blob: <i style =" color : #267f99 " >mixed</i >): <i style =" color : #267f99 " >T</i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L178-L190 ' Source ')
49
49
{: #verify .signature}
50
50
51
51
Verifies the untrusted/unknown input and either accepts or rejects it.
@@ -70,7 +70,7 @@ number.verify('hello'); // throws
70
70
71
71
---
72
72
73
- <a href =" #value " >#</a > ** .value** (blob: <i style =" color : #267f99 " >mixed</i >): <i style =" color : #267f99 " >T | undefined</i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L193-L203 ' Source ')
73
+ <a href =" #value " >#</a > ** .value** (blob: <i style =" color : #267f99 " >mixed</i >): <i style =" color : #267f99 " >T | undefined</i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L192-L202 ' Source ')
74
74
{: #value .signature}
75
75
76
76
Verifies the untrusted/unknown input and either accepts or rejects it.
@@ -96,7 +96,7 @@ string.value(42); // undefined
96
96
97
97
---
98
98
99
- <a href =" #decode " >#</a > ** .decode** (blob: <i style =" color : #267f99 " >mixed</i >): <i style =" color : #267f99 " >DecodeResult< ; T> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L167-L177 ' Source ')
99
+ <a href =" #decode " >#</a > ** .decode** (blob: <i style =" color : #267f99 " >mixed</i >): <i style =" color : #267f99 " >DecodeResult< ; T> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L166-L176 ' Source ')
100
100
{: #decode .signature}
101
101
102
102
Verifies the untrusted/unknown input and either accepts or rejects it.
@@ -118,7 +118,7 @@ number.decode('hi'); // { ok: false, error: { type: 'scalar', value: 'hi', text
118
118
119
119
---
120
120
121
- <a href =" #transform " >#</a > ** .transform** < ; <i style =" color : #267f99 " >V</i >> ; (transformFn: <i style =" color : #267f99 " >(T) => ; V</i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L205-L213 ' Source ')
121
+ <a href =" #transform " >#</a > ** .transform** < ; <i style =" color : #267f99 " >V</i >> ; (transformFn: <i style =" color : #267f99 " >(T) => ; V</i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L204-L212 ' Source ')
122
122
{: #transform .signature}
123
123
124
124
Accepts any value the given decoder accepts, and on success, will call
@@ -138,7 +138,7 @@ upper.verify(4); // throws
138
138
139
139
---
140
140
141
- <a href =" #refine " >#</a > ** .refine** (predicate: <i style =" color : #267f99 " >T => ; boolean</i >, message: <i style =" color : #267f99 " >string</i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; T> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L215-L228 ' Source ')
141
+ <a href =" #refine " >#</a > ** .refine** (predicate: <i style =" color : #267f99 " >T => ; boolean</i >, message: <i style =" color : #267f99 " >string</i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; T> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L214-L227 ' Source ')
142
142
{: #refine .signature}
143
143
144
144
Adds an extra predicate to a decoder. The new decoder is like the
@@ -163,7 +163,7 @@ In TypeScript, if you provide a predicate that also is a [type predicate](https:
163
163
164
164
---
165
165
166
- <a href =" #reject " >#</a > ** .reject** (rejectFn: <i style =" color : #267f99 " >T => ; string | null</i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; T> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L272-L290 ' Source ')
166
+ <a href =" #reject " >#</a > ** .reject** (rejectFn: <i style =" color : #267f99 " >T => ; string | null</i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; T> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L271-L289 ' Source ')
167
167
{: #reject .signature}
168
168
169
169
Adds an extra predicate to a decoder. The new decoder is like the
@@ -196,7 +196,7 @@ decoder.verify({ id: 123, _name: 'Vincent' }) // throws: "Disallowed keys: _n
196
196
197
197
---
198
198
199
- <a href =" #describe " >#</a > ** .describe** (message: <i style =" color : #267f99 " >string</i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; T> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L292-L309 ' Source ')
199
+ <a href =" #describe " >#</a > ** .describe** (message: <i style =" color : #267f99 " >string</i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; T> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L291-L308 ' Source ')
200
200
{: #describe .signature}
201
201
202
202
Uses the given decoder, but will use an alternative error message in case it rejects. This can be used to simplify or shorten otherwise long or low-level/technical errors.
@@ -208,10 +208,10 @@ const vowel = oneOf(['a', 'e', 'i', 'o', 'u'])
208
208
209
209
---
210
210
211
- <a href =" #then " >#</a > ** .then** < ; <i style =" color : #267f99 " >V</i >> ; (next: <i style =" color : #267f99 " >(blob: T, ok, err) => ; DecodeResult< ; V> ; | <a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L230-L248 ' Source ')
211
+ <a href =" #then " >#</a > ** .then** < ; <i style =" color : #267f99 " >V</i >> ; (next: <i style =" color : #267f99 " >(blob: T, ok, err) => ; DecodeResult< ; V> ; | <a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L229-L247 ' Source ')
212
212
{: #then .signature}
213
213
214
- <a href =" #then " >#</a > ** .then** < ; <i style =" color : #267f99 " >V</i >> ; (next: <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L230-L248 ' Source ')
214
+ <a href =" #then " >#</a > ** .then** < ; <i style =" color : #267f99 " >V</i >> ; (next: <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L229-L247 ' Source ')
215
215
{: #then .signature}
216
216
217
217
Send the output of the current decoder into another decoder or acceptance
@@ -225,10 +225,10 @@ current decoder as its input.
225
225
226
226
---
227
227
228
- <a href =" #pipe " >#</a > ** .pipe** < ; <i style =" color : #267f99 " >V</i >> ; (next: <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L250-L270 ' Source ')
228
+ <a href =" #pipe " >#</a > ** .pipe** < ; <i style =" color : #267f99 " >V</i >> ; (next: <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L249-L269 ' Source ')
229
229
{: #pipe .signature}
230
230
231
- <a href =" #pipe " >#</a > ** .pipe** < ; <i style =" color : #267f99 " >V</i >> ; (next: <i style =" color : #267f99 " >(blob: T) => ; <a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L250-L270 ' Source ')
231
+ <a href =" #pipe " >#</a > ** .pipe** < ; <i style =" color : #267f99 " >V</i >> ; (next: <i style =" color : #267f99 " >(blob: T) => ; <a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i >): <i style =" color : #267f99 " ><a href =" /Decoder.html " style =" color : inherit " >Decoder</a >< ; V> ; </i > [ <small >(source)</small >] ( https://github.com/nvie/decoders/tree/main/src/core/Decoder.ts#L249-L269 ' Source ')
232
232
{: #pipe .signature}
233
233
234
234
``` tsx
@@ -266,5 +266,5 @@ string
266
266
);
267
267
```
268
268
269
- <!-- [[[end]]] (checksum: c31601057bc8857b48dc4a8d6945a44a ) -->
269
+ <!-- [[[end]]] (checksum: 54a7a0358bb675eb7864ceeaa958b144 ) -->
270
270
<!-- prettier-ignore-end -->
0 commit comments