mirror of
https://github.com/tauri-apps/tauri-forage.git
synced 2026-02-04 18:51:21 +01:00
1012 lines
14 KiB
HTML
1012 lines
14 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
<title>JSDoc: handler</title>
|
|
|
|
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
|
|
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
|
<script src="./build/entry.js"></script>
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
|
<!--[if lt IE 9]>
|
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
<![endif]-->
|
|
<link href="https://fonts.googleapis.com/css?family=Muli:100,400,700|Oswald:300|Inconsolata,700" rel="stylesheet">
|
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
|
|
<link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
|
|
<link type="text/css" rel="stylesheet" href="styles/app.min.css">
|
|
<link type="text/css" rel="stylesheet" href="styles/iframe.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="stickyNavbarOverlay"></div>
|
|
<div class="top-navbar">
|
|
<div class="container">
|
|
<nav class="navbar" role="navigation" aria-label="main navigation">
|
|
<div class="navbar-brand">
|
|
|
|
|
|
<h1 class="navbar-item">tauri-forage Documentation</h1>
|
|
|
|
<a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
|
|
<span aria-hidden="true"></span>
|
|
<span aria-hidden="true"></span>
|
|
<span aria-hidden="true"></span>
|
|
</a>
|
|
</div>
|
|
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
<div class="container">
|
|
<div class="columns">
|
|
<div class="column is-3" id="sidebarNav">
|
|
<div class="sidebar">
|
|
<nav>
|
|
<h2><a href="index.html">Home</a></h2><div class="category"></div><div class="category"><h2>crypto</h2><h3>Namespaces</h3><ul><li><a href="crypto.html">crypto</a></li><li><a href="crypto.box.html">box</a></li><li><a href="crypto.secretBox.html">secretBox</a></li></ul></div><div class="category"><h2>forage</h2><h3>Namespaces</h3><ul><li><a href="cryptoForage.html">cryptoForage</a></li><li><a href="forage.html">forage</a></li></ul></div><div class="category"><h2>handler</h2><h3>Namespaces</h3><ul><li><a href="handler.html">handler</a></li></ul></div>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
<div class="column is-9-desktop">
|
|
<div class="content" id="main-content-wrapper">
|
|
<header class="page-title">
|
|
<p>Namespace</p>
|
|
<h1>handler</h1>
|
|
</header>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<header>
|
|
|
|
<h2>handler</h2>
|
|
|
|
|
|
</header>
|
|
|
|
<article>
|
|
<div class="container-overview">
|
|
|
|
|
|
<div class="description"><script type="text/javascript" src="https://unpkg.com/mermaid@7.1.0/dist/mermaid.min.js"></script></div>
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="tag-source">
|
|
<a href="handler.esm.js.html" class="button">View Source</a>
|
|
<span>
|
|
<a href="handler.esm.js.html">handler.esm.js</a>, <a href="handler.esm.js.html#line4">line 4</a>
|
|
</span>
|
|
</p>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='vertical-section'>
|
|
<h3 class="title"><span>Methods</span></h3>
|
|
<div class="members">
|
|
|
|
<div class="member">
|
|
|
|
|
|
|
|
<h4 class="name" id=".jsonPurify">
|
|
<a class="href-link" href="#.jsonPurify">#</a>
|
|
|
|
|
|
<span class='tag'>static</span>
|
|
|
|
|
|
<span class="code-name">
|
|
|
|
jsonPurify<span class="signature">(model, maxLen)</span><span class="type-signature"></span>
|
|
|
|
</span>
|
|
</h4>
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
<script type="text/javascript" src="https://unpkg.com/mermaid@7.1.0/dist/mermaid.min.js"></script><p>accepts an array and tries to parse the object passed</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Parameters:</h5>
|
|
|
|
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<tr class="deep-level-0">
|
|
|
|
<td class="name"><code>model</code></td>
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
<span class="param-type">object</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>the model to map against</p></td>
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr class="deep-level-0">
|
|
|
|
<td class="name"><code>maxLen</code></td>
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
<span class="param-type">number</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"><p>max length of model</p></td>
|
|
</tr>
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="tag-source">
|
|
<a href="handler.esm.js.html" class="button">View Source</a>
|
|
<span>
|
|
<a href="handler.esm.js.html">handler.esm.js</a>, <a href="handler.esm.js.html#line195">line 195</a>
|
|
</span>
|
|
</p>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="member">
|
|
|
|
|
|
|
|
<h4 class="name" id=".logger">
|
|
<a class="href-link" href="#.logger">#</a>
|
|
|
|
|
|
<span class='tag'>static</span>
|
|
|
|
|
|
<span class="code-name">
|
|
|
|
logger<span class="signature">(msg, type)</span><span class="type-signature"> → {*}</span>
|
|
|
|
</span>
|
|
</h4>
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
<script type="text/javascript" src="https://unpkg.com/mermaid@7.1.0/dist/mermaid.min.js"></script><p>Set logging type for returning errors in a number of ways.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Parameters:</h5>
|
|
|
|
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<tr class="deep-level-0">
|
|
|
|
<td class="name"><code>msg</code></td>
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
<span class="param-type">*</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"></td>
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr class="deep-level-0">
|
|
|
|
<td class="name"><code>type</code></td>
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
<span class="param-type">MaybeLoggerType</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"></td>
|
|
</tr>
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="tag-source">
|
|
<a href="handler.esm.js.html" class="button">View Source</a>
|
|
<span>
|
|
<a href="handler.esm.js.html">handler.esm.js</a>, <a href="handler.esm.js.html#line93">line 93</a>
|
|
</span>
|
|
</p>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='columns method-parameter'>
|
|
<div class="column is-2"><label>Throws:</label></div>
|
|
<div class="column is-10">
|
|
|
|
|
|
<div class="columns">
|
|
|
|
<div class='param-desc column is-7'><ul>
|
|
<li>just the message it is passed</li>
|
|
</ul></div>
|
|
<div class='column is-5 has-text-left'>
|
|
<label>Type: </label>
|
|
<span class="param-type">Error</span>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class='columns method-parameter'>
|
|
<div class="column is-2"><label>Returns:</label></div>
|
|
<div class="column is-10">
|
|
|
|
|
|
|
|
<div class="columns">
|
|
|
|
|
|
<div class='column is-5 has-text-left'>
|
|
<label>Type: </label>
|
|
|
|
<span class="param-type">*</span>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="member">
|
|
|
|
|
|
|
|
<h4 class="name" id=".maybeCurry">
|
|
<a class="href-link" href="#.maybeCurry">#</a>
|
|
|
|
|
|
<span class='tag'>static</span>
|
|
|
|
|
|
<span class="code-name">
|
|
|
|
maybeCurry<span class="signature">(fn, val)</span><span class="type-signature"> → {*}</span>
|
|
|
|
</span>
|
|
</h4>
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
<script type="text/javascript" src="https://unpkg.com/mermaid@7.1.0/dist/mermaid.min.js"></script><p>If a function is passed, apply it to the value.
|
|
Otherwise, just return the value.</p>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Parameters:</h5>
|
|
|
|
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<tr class="deep-level-0">
|
|
|
|
<td class="name"><code>fn</code></td>
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
<span class="param-type">function</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"></td>
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr class="deep-level-0">
|
|
|
|
<td class="name"><code>val</code></td>
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
<span class="param-type">*</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"></td>
|
|
</tr>
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="tag-source">
|
|
<a href="handler.esm.js.html" class="button">View Source</a>
|
|
<span>
|
|
<a href="handler.esm.js.html">handler.esm.js</a>, <a href="handler.esm.js.html#line167">line 167</a>
|
|
</span>
|
|
</p>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='columns method-parameter'>
|
|
<div class="column is-2"><label>Returns:</label></div>
|
|
<div class="column is-10">
|
|
|
|
|
|
|
|
<div class="columns">
|
|
|
|
|
|
<div class='column is-5 has-text-left'>
|
|
<label>Type: </label>
|
|
|
|
<span class="param-type">*</span>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="member">
|
|
|
|
|
|
|
|
<h4 class="name" id=".returner">
|
|
<a class="href-link" href="#.returner">#</a>
|
|
|
|
|
|
<span class='tag'>static</span>
|
|
|
|
|
|
<span class="code-name">
|
|
|
|
returner<span class="signature">(val, type)</span><span class="type-signature"> → {*}</span>
|
|
|
|
</span>
|
|
</h4>
|
|
|
|
|
|
|
|
|
|
<div class="description">
|
|
<script type="text/javascript" src="https://unpkg.com/mermaid@7.1.0/dist/mermaid.min.js"></script><p>Return the value - or don't.
|
|
Of special note is case 4, which will tell you if the
|
|
result of the operation is true, false, null or undefined.
|
|
You can use numbers or strings</p>
|
|
<h2>TYPES</h2>
|
|
<ul>
|
|
<li>1(quiet) - return void 0</li>
|
|
<li>2(console) - log the returned value to the console</li>
|
|
<li>3(break) - throw an error with the contents of the return</li>
|
|
<li>4(truthy) - return a true or false value</li>
|
|
<li>5(typeof) - return type of response</li>
|
|
<li>6(trace) - get a console.trace() of the call stack</li>
|
|
<li>7(passthrough) - the default does nothing to the return</li>
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h5>Parameters:</h5>
|
|
|
|
|
|
<table class="params">
|
|
<thead>
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
|
|
<th>Type</th>
|
|
|
|
|
|
|
|
|
|
|
|
<th class="last">Description</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<tr class="deep-level-0">
|
|
|
|
<td class="name"><code>val</code></td>
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
<span class="param-type">*</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"></td>
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
<tr class="deep-level-0">
|
|
|
|
<td class="name"><code>type</code></td>
|
|
|
|
|
|
<td class="type">
|
|
|
|
|
|
<span class="param-type">MaybeReturnerType</span>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
|
|
<td class="description last"></td>
|
|
</tr>
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<dl class="details">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p class="tag-source">
|
|
<a href="handler.esm.js.html" class="button">View Source</a>
|
|
<span>
|
|
<a href="handler.esm.js.html">handler.esm.js</a>, <a href="handler.esm.js.html#line9">line 9</a>
|
|
</span>
|
|
</p>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='columns method-parameter'>
|
|
<div class="column is-2"><label>Throws:</label></div>
|
|
<div class="column is-10">
|
|
|
|
|
|
<div class="columns">
|
|
|
|
<div class='param-desc column is-7'><p>the message it is passed (if type 3)</p></div>
|
|
<div class='column is-5 has-text-left'>
|
|
<label>Type: </label>
|
|
<span class="param-type">Error</span>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class='columns method-parameter'>
|
|
<div class="column is-2"><label>Returns:</label></div>
|
|
<div class="column is-10">
|
|
|
|
|
|
|
|
<div class="columns">
|
|
|
|
|
|
<div class='column is-5 has-text-left'>
|
|
<label>Type: </label>
|
|
|
|
<span class="param-type">*</span>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</article>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<footer class="footer">
|
|
<div class="content has-text-centered">
|
|
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a></p>
|
|
<p class="sidebar-created-by">
|
|
<a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
|
|
<a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
|
|
</p>
|
|
</div>
|
|
</footer>
|
|
|
|
|
|
<script src="scripts/app.min.js"></script>
|
|
<script src="scripts/linenumber.js"> </script>
|
|
</body>
|
|
</html> |