Skip to content

Commit

Permalink
Update docs for new exports
Browse files Browse the repository at this point in the history
  • Loading branch information
kofno committed Apr 24, 2017
1 parent 533d4d2 commit 0a613b2
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions docs/classes/_decoder_.decoder.html
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ <h3>constructor</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:14</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L14">Decoder.ts:14</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -1063,7 +1063,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> fn</h3>
<div class="tsd-signature tsd-kind-icon">fn<span class="tsd-signature-symbol">:</span> <a href="../modules/_decoder_.html#decoderfn" class="tsd-signature-type">DecoderFn</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">A</span><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:14</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L14">Decoder.ts:14</a></li>
</ul>
</aside>
</section>
Expand All @@ -1080,7 +1080,7 @@ <h3>and<wbr>Then</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:37</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L37">Decoder.ts:37</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1136,7 +1136,7 @@ <h3>ap</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:56</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L56">Decoder.ts:56</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1171,7 +1171,7 @@ <h3>decode<wbr>Any</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:66</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L66">Decoder.ts:66</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1199,7 +1199,7 @@ <h3>decode<wbr>Json</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:75</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L75">Decoder.ts:75</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1229,7 +1229,7 @@ <h3>map</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:23</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L23">Decoder.ts:23</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1281,7 +1281,7 @@ <h3>or<wbr>Else</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:46</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L46">Decoder.ts:46</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
14 changes: 7 additions & 7 deletions docs/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ <h1 id="jsonous">jsonous</h1>
<p>If you&#39;re building a web application, you&#39;re eventually going to need a reliable
way to convert JSON into type that you can use. <code>JSON.parse</code> will only get you
so far.</p>
<p>A better solution allows you verify the structure of the source data while
<p>A better solution allows you to verify the structure of the source data while
converting it into the types you need to work with. It handles variations in
content structure. In a typed environment, it preserves your types so you don&#39;t
have to pass <code>any</code> types around. Errors are handled gracefully using a Result
Expand Down Expand Up @@ -961,7 +961,7 @@ <h2 id="primitives">primitives</h2>
.decodeAny({ userId: <span class="hljs-number">213</span>, emailAddress: <span class="hljs-string">'[email protected]'</span> })
<span class="hljs-comment">// --&gt; Ok({ id: 213, email: '[email protected]'})</span>
</code></pre><p>For an object of any moderate complexity, this nesting may become an eyesore.</p>
<p>Objects can also built using in the applicative style.</p>
<p>Objects can also be built using the applicative style.</p>
<pre><code><span class="hljs-keyword">const</span> ctor = <span class="hljs-function">(<span class="hljs-params">id: <span class="hljs-built_in">number</span></span>) =&gt;</span> (email: <span class="hljs-built_in">string</span>) =&gt; ({ id, email });
<span class="hljs-keyword">const</span> decoder = succeed(ctor)
.ap(field(<span class="hljs-string">'userId'</span>, <span class="hljs-built_in">number</span>()))
Expand All @@ -980,13 +980,13 @@ <h2 id="primitives">primitives</h2>
That depends on your own preferences and what&#39;s appropriate for the situation.</p>
<p>In any case, the best strategy for handling object construction with decoders
is to compose complex decoders from smaller, simpler decoders.</p>
<pre><code>field(<span class="hljs-string">"user"</span>, userDecoder.andThen(<span class="hljs-function"><span class="hljs-params">user</span> =&gt;</span>
at([<span class="hljs-string">"student"</span>, <span class="hljs-string">"courses"</span>], array(courseDecoder)).andThen(<span class="hljs-function"><span class="hljs-params">courses</span> =&gt;</span>
succeed({ user, courses })
<pre><code><span class="hljs-function"><span class="hljs-title">field</span><span class="hljs-params">(<span class="hljs-string">"user"</span>, userDecoder)</span></span>.andThen(user =&gt;
<span class="hljs-function"><span class="hljs-title">at</span><span class="hljs-params">([<span class="hljs-string">"student"</span>, <span class="hljs-string">"courses"</span>], array(courseDecoder)</span></span>).andThen(courses =&gt;
<span class="hljs-function"><span class="hljs-title">succeed</span><span class="hljs-params">({ user, courses })</span></span>
.decodeJson(<span class="hljs-string">'... some json ... '</span>)

<span class="hljs-keyword">const</span> userDecoder = <span class="hljs-comment">//...</span>
<span class="hljs-keyword">const</span> courseDecoder = <span class="hljs-comment">//...</span>
const userDecoder = <span class="hljs-comment">//...</span>
const courseDecoder = <span class="hljs-comment">//...</span>
</code></pre><h1 id="docs">docs</h1>
<p><a href="https://kofno.github.io/jsonous">API</a></p>
</div>
Expand Down
14 changes: 7 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ <h1 id="jsonous">jsonous</h1>
<p>If you&#39;re building a web application, you&#39;re eventually going to need a reliable
way to convert JSON into type that you can use. <code>JSON.parse</code> will only get you
so far.</p>
<p>A better solution allows you verify the structure of the source data while
<p>A better solution allows you to verify the structure of the source data while
converting it into the types you need to work with. It handles variations in
content structure. In a typed environment, it preserves your types so you don&#39;t
have to pass <code>any</code> types around. Errors are handled gracefully using a Result
Expand Down Expand Up @@ -961,7 +961,7 @@ <h2 id="primitives">primitives</h2>
.decodeAny({ userId: <span class="hljs-number">213</span>, emailAddress: <span class="hljs-string">'[email protected]'</span> })
<span class="hljs-comment">// --&gt; Ok({ id: 213, email: '[email protected]'})</span>
</code></pre><p>For an object of any moderate complexity, this nesting may become an eyesore.</p>
<p>Objects can also built using in the applicative style.</p>
<p>Objects can also be built using the applicative style.</p>
<pre><code><span class="hljs-keyword">const</span> ctor = <span class="hljs-function">(<span class="hljs-params">id: <span class="hljs-built_in">number</span></span>) =&gt;</span> (email: <span class="hljs-built_in">string</span>) =&gt; ({ id, email });
<span class="hljs-keyword">const</span> decoder = succeed(ctor)
.ap(field(<span class="hljs-string">'userId'</span>, <span class="hljs-built_in">number</span>()))
Expand All @@ -980,13 +980,13 @@ <h2 id="primitives">primitives</h2>
That depends on your own preferences and what&#39;s appropriate for the situation.</p>
<p>In any case, the best strategy for handling object construction with decoders
is to compose complex decoders from smaller, simpler decoders.</p>
<pre><code>field(<span class="hljs-string">"user"</span>, userDecoder.andThen(<span class="hljs-function"><span class="hljs-params">user</span> =&gt;</span>
at([<span class="hljs-string">"student"</span>, <span class="hljs-string">"courses"</span>], array(courseDecoder)).andThen(<span class="hljs-function"><span class="hljs-params">courses</span> =&gt;</span>
succeed({ user, courses })
<pre><code><span class="hljs-function"><span class="hljs-title">field</span><span class="hljs-params">(<span class="hljs-string">"user"</span>, userDecoder)</span></span>.andThen(user =&gt;
<span class="hljs-function"><span class="hljs-title">at</span><span class="hljs-params">([<span class="hljs-string">"student"</span>, <span class="hljs-string">"courses"</span>], array(courseDecoder)</span></span>).andThen(courses =&gt;
<span class="hljs-function"><span class="hljs-title">succeed</span><span class="hljs-params">({ user, courses })</span></span>
.decodeJson(<span class="hljs-string">'... some json ... '</span>)

<span class="hljs-keyword">const</span> userDecoder = <span class="hljs-comment">//...</span>
<span class="hljs-keyword">const</span> courseDecoder = <span class="hljs-comment">//...</span>
const userDecoder = <span class="hljs-comment">//...</span>
const courseDecoder = <span class="hljs-comment">//...</span>
</code></pre><h1 id="docs">docs</h1>
<p><a href="https://kofno.github.io/jsonous">API</a></p>
</div>
Expand Down
22 changes: 11 additions & 11 deletions docs/modules/_decoder_.html
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ <h3>Decoder<wbr>Fn</h3>
<div class="tsd-signature tsd-kind-icon">Decoder<wbr>Fn<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">function</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:7</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L7">Decoder.ts:7</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1034,7 +1034,7 @@ <h3>array</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:142</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L142">Decoder.ts:142</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1068,7 +1068,7 @@ <h3>at</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:174</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L174">Decoder.ts:174</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1105,7 +1105,7 @@ <h3>boolean</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:129</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L129">Decoder.ts:129</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -1127,7 +1127,7 @@ <h3>fail</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:96</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L96">Decoder.ts:96</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1156,7 +1156,7 @@ <h3>field</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:160</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L160">Decoder.ts:160</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1193,7 +1193,7 @@ <h3>maybe</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:192</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L192">Decoder.ts:192</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1227,7 +1227,7 @@ <h3>number</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:116</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L116">Decoder.ts:116</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -1249,7 +1249,7 @@ <h3>one<wbr>Of</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:205</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L205">Decoder.ts:205</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -1284,7 +1284,7 @@ <h3>string</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:103</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L103">Decoder.ts:103</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -1306,7 +1306,7 @@ <h3>succeed</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in Decoder.ts:88</li>
<li>Defined in <a href="https://github.com/kofno/jsonous/blob/db4fc56/src/Decoder.ts#L88">Decoder.ts:88</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down

0 comments on commit 0a613b2

Please sign in to comment.