Skip to content

Commit 264fd55

Browse files
committed
Optimize width of readme table
1 parent 3a40352 commit 264fd55

File tree

1 file changed

+74
-78
lines changed

1 file changed

+74
-78
lines changed

README.md

Lines changed: 74 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,20 @@ Here’s a summary of all codecs (with slightly simplified type annotations) and
172172
</tr>
173173
<th><a href="#primitiveunion">primitiveUnion</a></th>
174174
<td><pre>(variants: [
175-
"string1",
175+
"string1",
176176
"string2",
177177
"stringN",
178178
1,
179179
2,
180180
true
181-
]) =&gt;
182-
Codec&lt;
183-
"string1"
184-
| "string2"
185-
| "stringN"
186-
| 1
187-
| 2
188-
| true
189-
&gt;</pre></td>
181+
]) =&gt; Codec&lt;
182+
"string1"
183+
| "string2"
184+
| "stringN"
185+
| 1
186+
| 2
187+
| true
188+
&gt;</pre></td>
190189
<td>string, number, boolean, null</td>
191190
<td><pre>"string1"
192191
| "string2"
@@ -198,101 +197,99 @@ Here’s a summary of all codecs (with slightly simplified type annotations) and
198197
<tr>
199198
<th><a href="#array">array</a></th>
200199
<td><pre>(decoder: Codec&lt;T&gt;) =&gt;
201-
Codec&lt;Array&lt;T&gt;&gt;</pre></td>
200+
Codec&lt;Array&lt;T&gt;&gt;</pre></td>
202201
<td>array</td>
203202
<td><code>Array&lt;T&gt;</code></td>
204203
</tr>
205204
<tr>
206205
<th><a href="#record">record</a></th>
207206
<td><pre>(decoder: Codec&lt;T&gt;) =&gt;
208-
Codec&lt;Record&lt;string, T&gt;&gt;</pre></td>
207+
Codec&lt;Record&lt;string, T&gt;&gt;</pre></td>
209208
<td>object</td>
210209
<td><code>Record&lt;string, T&gt;</code></td>
211210
</tr>
212211
<tr>
213212
<th><a href="#fields">fields</a></th>
214213
<td><pre>(mapping: {
215-
field1: Codec&lt;T1&gt;,
216-
field2: Field&lt;T2, {optional: true}&gt;,
217-
field3: Field&lt;T3, {renameFrom: "field_3"}&gt;,
218-
fieldN: Codec&lt;TN&gt;
219-
}) =&gt;
220-
Codec&lt;{
221-
field1: T1,
222-
field2?: T2,
223-
field3: T3,
224-
fieldN: TN
225-
}&gt;</pre></td>
214+
field1: Codec&lt;T1&gt;,
215+
field2: Field&lt;T2,
216+
{optional: true}&gt;,
217+
field3: Field&lt;T3,
218+
{renameFrom: "field_3"}&gt;,
219+
fieldN: Codec&lt;TN&gt;
220+
}) =&gt; Codec&lt;{
221+
field1: T1,
222+
field2?: T2,
223+
field3: T3,
224+
fieldN: TN
225+
}&gt;</pre></td>
226226
<td><pre>{
227-
"field1": ...,
228-
"field2": ...,
229-
"field_3": ...,
230-
"fieldN": ...
227+
"field1": ...,
228+
"field2": ...,
229+
"field_3": ...,
230+
"fieldN": ...
231231
}</pre> or: <pre>{
232-
"field1": ...,
233-
"field_3": ...,
234-
"fieldN": ...
232+
"field1": ...,
233+
"field_3": ...,
234+
"fieldN": ...
235235
}</pre></td>
236236
<td><pre>{
237-
field1: T1,
238-
field2?: T2,
239-
field3: T3,
240-
fieldN: TN
237+
field1: T1,
238+
field2?: T2,
239+
field3: T3,
240+
fieldN: TN
241241
}</pre></td>
242242
</tr>
243243
<tr>
244244
<th><a href="#field">field</a></th>
245245
<td><pre>(
246-
codec: Codec&lt;Decoded&gt;,
247-
meta: Meta,
248-
) => Field&lt;Decoded, Meta&gt;</pre></td>
246+
codec: Codec&lt;Decoded&gt;,
247+
meta: Meta,
248+
) =&gt; Field&lt;Decoded, Meta&gt;</pre></td>
249249
<td>n/a</td>
250250
<td>n/a, only used with <code>fields</code></td>
251251
</tr>
252252
<tr>
253253
<th><a href="#taggedunion">taggedUnion</a></th>
254254
<td><pre>(
255-
decodedCommonField: string,
256-
variants: Array&lt;
257-
Parameters&lt;typeof fields&gt;[0]
258-
&gt;,
259-
) =&gt;
260-
Codec&lt;T1 | T2 | TN&gt;</pre></td>
255+
decodedCommonField: string,
256+
variants: Array&lt;
257+
Parameters&lt;typeof fields&gt;[0]
258+
&gt;,
259+
) =&gt; Codec&lt;T1 | T2 | TN&gt;</pre></td>
261260
<td>object</td>
262261
<td><code>T1 | T2 | TN</code></td>
263262
</tr>
264263
<tr>
265264
<th><a href="#tag">tag</a></th>
266265
<td><pre>(
267-
decoded: "string literal",
268-
options?: Options,
269-
) => Field&lt;"string literal", Meta&gt;</pre></td>
266+
decoded: "string literal",
267+
options?: Options,
268+
) =&gt; Field&lt;"string literal", Meta&gt;</pre></td>
270269
<td>string</td>
271270
<td><code>"string literal"</code></td>
272271
</tr>
273272
<tr>
274273
<th><a href="#tuple">tuple</a></th>
275274
<td><pre>(codecs: [
276-
Codec&lt;T1&gt;,
277-
Codec&lt;T2&gt;,
278-
Codec&lt;TN&gt;
279-
]) =&gt;
280-
Codec&lt;[T1, T2, TN]&gt;</pre></td>
275+
Codec&lt;T1&gt;,
276+
Codec&lt;T2&gt;,
277+
Codec&lt;TN&gt;
278+
]) =&gt; Codec&lt;[T1, T2, TN]&gt;</pre></td>
281279
<td>array</td>
282280
<td><code>[T1, T2, TN]</code></td>
283281
</tr>
284282
<tr>
285283
<th><a href="#multi">multi</a></th>
286284
<td><pre>(types: [
287-
"type1",
288-
"type2",
289-
"type10"
290-
]) =&gt;
291-
Codec&lt;
292-
{ type: "type1", value: type1 }
293-
| { type: "type2", value: type2 }
294-
| { type: "type10", value: type10 }
295-
&gt;</pre></td>
285+
"type1",
286+
"type2",
287+
"type10"
288+
]) =&gt; Codec&lt;
289+
{ type: "type1", value: type1 }
290+
| { type: "type2", value: type2 }
291+
| { type: "type10", value: type10 }
292+
&gt;</pre></td>
296293
<td>you decide</td>
297294
<td>A subset of: <pre>{ type: "undefined"; value: undefined }
298295
| { type: "null"; value: null }
@@ -307,48 +304,47 @@ Here’s a summary of all codecs (with slightly simplified type annotations) and
307304
</tr>
308305
<tr>
309306
<th><a href="#recursive">recursive</a></th>
310-
<td><pre>(callback: () => Codec&lt;T&gt;) =&gt;
311-
Codec&lt;T&gt;</pre></td>
307+
<td><pre>(callback: () =&gt; Codec&lt;T&gt;) =&gt;
308+
Codec&lt;T&gt;</pre></td>
312309
<td>n/a</td>
313310
<td><code>T</code></td>
314311
</tr>
315312
<tr>
316313
<th><a href="#undefinedor">undefinedOr</a></th>
317314
<td><pre>(codec: Codec&lt;T&gt;) =&gt;
318-
Codec&lt;T | undefined&gt;</pre></td>
315+
Codec&lt;T | undefined&gt;</pre></td>
319316
<td>undefined or …</td>
320317
<td><code>T | undefined</code></td>
321318
</tr>
322319
<tr>
323320
<th><a href="#nullOr">nullOr</a></th>
324321
<td><pre>(codec: Codec&lt;T&gt;) =&gt;
325-
Codec&lt;T | null&gt;</pre></td>
322+
Codec&lt;T | null&gt;</pre></td>
326323
<td>null or …</td>
327324
<td><code>T | null</code></td>
328325
</tr>
329326
<tr>
330327
<th><a href="#map">map</a></th>
331328
<td><pre>(
332-
codec: Codec&lt;T&gt;,
333-
transform: {
334-
decoder: (value: T) =&gt; U;
335-
encoder: (value: U) =&gt; T;
336-
},
337-
) =&gt;
338-
Codec&lt;U&gt;</pre></td>
329+
codec: Codec&lt;T&gt;,
330+
transform: {
331+
decoder: (value: T) =&gt; U;
332+
encoder: (value: U) =&gt; T;
333+
},
334+
) =&gt; Codec&lt;U&gt;</pre></td>
339335
<td>n/a</td>
340336
<td><code>U</code></td>
341337
</tr>
342338
<tr>
343339
<th><a href="#flatmap">flatMap</a></th>
344340
<td><pre>(
345-
decoder: Codec&lt;T&gt;,
346-
transform: {
347-
decoder: (value: T) =&gt; DecoderResult&lt;U&gt;;
348-
encoder: (value: U) =&gt; T;
349-
},
350-
) =&gt;
351-
Codec&lt;U&gt;</pre></td>
341+
decoder: Codec&lt;T&gt;,
342+
transform: {
343+
decoder: (value: T) =&gt;
344+
DecoderResult&lt;U&gt;;
345+
encoder: (value: U) =&gt; T;
346+
},
347+
) =&gt; Codec&lt;U&gt;</pre></td>
352348
<td>n/a</td>
353349
<td><code>U</code></td>
354350
</tr>

0 commit comments

Comments
 (0)