Skip to content

Commit c930716

Browse files
committed
Deploy website
Deploy website version based on 008a0ae8e764734f496967137e0ccafe09f49743
1 parent 820cb6c commit c930716

8 files changed

Lines changed: 66 additions & 26 deletions

docs/custom-validators-sanitizers.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ <h2><a class="anchor" aria-hidden="true" id="custom-sanitizers"></a><a href="#cu
100100
Just like with the validators, you specify the sanitizer function, which <em>must</em> be synchronous at the
101101
moment.</p>
102102
<h3><a class="anchor" aria-hidden="true" id="example-converting-to-mongodbs-objectid"></a><a href="#example-converting-to-mongodbs-objectid" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Example: converting to MongoDB's ObjectID</h3>
103-
<pre><code class="hljs css language-js"><span class="hljs-keyword">const</span> { sanitizeParam } = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express-validator'</span>);
103+
<pre><code class="hljs css language-js"><span class="hljs-keyword">const</span> { param } = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express-validator'</span>);
104104

105-
app.post(<span class="hljs-string">'/object/:id'</span>, sanitizeParam(<span class="hljs-string">'id'</span>).customSanitizer(<span class="hljs-function"><span class="hljs-params">value</span> =&gt;</span> {
105+
app.post(<span class="hljs-string">'/object/:id'</span>, param(<span class="hljs-string">'id'</span>).customSanitizer(<span class="hljs-function"><span class="hljs-params">value</span> =&gt;</span> {
106106
<span class="hljs-keyword">return</span> ObjectId(value);
107107
}), (req, res) =&gt; {
108108
<span class="hljs-comment">// Handle the request</span>

docs/filter-api.html

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
});
5757
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/express-validator/express-validator/edit/master/docs/api-filter.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 id="__docusaurus" class="postHeaderTitle">Sanitization middlewares</h1></header><article><div><span><p>These methods are all available via <code>require('express-validator')</code>.</p>
5858
<blockquote>
59-
<p>These sanitization-only middlewares have been deprecated, as the <a href="/docs/check-api.html">validation ones</a>
60-
offer the same functionality, and much more.
59+
<p>These sanitization-only middlewares have been deprecated, as <strong>the <a href="/docs/check-api.html">validation middlewares</a>
60+
offer the same functionality</strong>, and much more.
6161
They will be removed eventually.</p>
6262
</blockquote>
6363
<h2><a class="anchor" aria-hidden="true" id="sanitizefields"></a><a href="#sanitizefields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitize(fields)</code></h2>
@@ -67,6 +67,9 @@ <h2><a class="anchor" aria-hidden="true" id="sanitizefields"></a><a href="#sanit
6767
<blockquote>
6868
<p><em>Returns:</em> a <a href="/docs/sanitization-chain-api.html">Sanitization Chain</a></p>
6969
</blockquote>
70+
<blockquote>
71+
<p><a href="/docs/check-api.html#checkfields-message">Prefer using <code>check()</code> instead</a>. This function has been deprecated.</p>
72+
</blockquote>
7073
<p>Creates a sanitization chain for one or more fields. They may be located in any of the following request objects:</p>
7174
<ul>
7275
<li><code>req.body</code></li>
@@ -78,12 +81,24 @@ <h2><a class="anchor" aria-hidden="true" id="sanitizefields"></a><a href="#sanit
7881
<p>If any of the fields are present in more than one location, then all instances of that field value will be sanitized.</p>
7982
<h2><a class="anchor" aria-hidden="true" id="sanitizebodyfields"></a><a href="#sanitizebodyfields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitizeBody(fields)</code></h2>
8083
<p>Same as <code>sanitize(fields)</code>, but only sanitizing <code>req.body</code>.</p>
84+
<blockquote>
85+
<p><a href="/docs/check-api.html#bodyfields-message">Prefer using <code>body()</code> instead</a>. This function has been deprecated.</p>
86+
</blockquote>
8187
<h2><a class="anchor" aria-hidden="true" id="sanitizecookiefields"></a><a href="#sanitizecookiefields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitizeCookie(fields)</code></h2>
8288
<p>Same as <code>sanitize(fields)</code>, but only sanitizing <code>req.cookies</code>.</p>
89+
<blockquote>
90+
<p><a href="/docs/check-api.html#cookiefields-message">Prefer using <code>cookie()</code> instead</a>. This function has been deprecated.</p>
91+
</blockquote>
8392
<h2><a class="anchor" aria-hidden="true" id="sanitizeparamfields"></a><a href="#sanitizeparamfields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitizeParam(fields)</code></h2>
8493
<p>Same as <code>sanitize(fields)</code>, but only sanitizing <code>req.params</code>.</p>
94+
<blockquote>
95+
<p><a href="/docs/check-api.html#paramfields-message">Prefer using <code>param()</code> instead</a>. This function has been deprecated.</p>
96+
</blockquote>
8597
<h2><a class="anchor" aria-hidden="true" id="sanitizequeryfields"></a><a href="#sanitizequeryfields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitizeQuery(fields)</code></h2>
8698
<p>Same as <code>sanitize(fields)</code>, but only sanitizing <code>req.query</code>.</p>
99+
<blockquote>
100+
<p><a href="/docs/check-api.html#queryfields-message">Prefer using <code>query()</code> instead</a>. This function has been deprecated.</p>
101+
</blockquote>
87102
<h2><a class="anchor" aria-hidden="true" id="buildsanitizefunctionlocations"></a><a href="#buildsanitizefunctionlocations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>buildSanitizeFunction(locations)</code></h2>
88103
<ul>
89104
<li><code>locations</code>: an array of request locations to gather data from.<br>
@@ -92,6 +107,9 @@ <h2><a class="anchor" aria-hidden="true" id="buildsanitizefunctionlocations"></a
92107
<blockquote>
93108
<p><em>Returns:</em> a variant of <a href="#sanitizefields"><code>sanitize()</code></a> sanitizing the given request locations.</p>
94109
</blockquote>
110+
<blockquote>
111+
<p><a href="/docs/check-api.html#buildcheckfunctionlocations">Prefer using <code>buildCheckFunction()</code> instead</a>. This function has been deprecated.</p>
112+
</blockquote>
95113
<p>Creates a variant of <a href="#sanitizefields"><code>sanitize()</code></a> that sanitizes the given request locations.</p>
96114
<pre><code class="hljs css language-js"><span class="hljs-keyword">const</span> { buildSanitizeFunction } = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express-validator'</span>);
97115
<span class="hljs-keyword">const</span> sanitizeBodyAndQuery = buildSanitizeFunction([<span class="hljs-string">'body'</span>, <span class="hljs-string">'query'</span>]);

docs/next/custom-validators-sanitizers.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ <h2><a class="anchor" aria-hidden="true" id="custom-sanitizers"></a><a href="#cu
100100
Just like with the validators, you specify the sanitizer function, which <em>must</em> be synchronous at the
101101
moment.</p>
102102
<h3><a class="anchor" aria-hidden="true" id="example-converting-to-mongodbs-objectid"></a><a href="#example-converting-to-mongodbs-objectid" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Example: converting to MongoDB's ObjectID</h3>
103-
<pre><code class="hljs css language-js"><span class="hljs-keyword">const</span> { sanitizeParam } = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express-validator'</span>);
103+
<pre><code class="hljs css language-js"><span class="hljs-keyword">const</span> { param } = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express-validator'</span>);
104104

105-
app.post(<span class="hljs-string">'/object/:id'</span>, sanitizeParam(<span class="hljs-string">'id'</span>).customSanitizer(<span class="hljs-function"><span class="hljs-params">value</span> =&gt;</span> {
105+
app.post(<span class="hljs-string">'/object/:id'</span>, param(<span class="hljs-string">'id'</span>).customSanitizer(<span class="hljs-function"><span class="hljs-params">value</span> =&gt;</span> {
106106
<span class="hljs-keyword">return</span> ObjectId(value);
107107
}), (req, res) =&gt; {
108108
<span class="hljs-comment">// Handle the request</span>

docs/next/filter-api.html

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
});
5757
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/express-validator/express-validator/edit/master/docs/api-filter.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 id="__docusaurus" class="postHeaderTitle">Sanitization middlewares</h1></header><article><div><span><p>These methods are all available via <code>require('express-validator')</code>.</p>
5858
<blockquote>
59-
<p>These sanitization-only middlewares have been deprecated, as the <a href="/docs/next/check-api.html">validation ones</a>
60-
offer the same functionality, and much more.
59+
<p>These sanitization-only middlewares have been deprecated, as <strong>the <a href="/docs/next/check-api.html">validation middlewares</a>
60+
offer the same functionality</strong>, and much more.
6161
They will be removed eventually.</p>
6262
</blockquote>
6363
<h2><a class="anchor" aria-hidden="true" id="sanitizefields"></a><a href="#sanitizefields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitize(fields)</code></h2>
@@ -67,6 +67,9 @@ <h2><a class="anchor" aria-hidden="true" id="sanitizefields"></a><a href="#sanit
6767
<blockquote>
6868
<p><em>Returns:</em> a <a href="/docs/next/sanitization-chain-api.html">Sanitization Chain</a></p>
6969
</blockquote>
70+
<blockquote>
71+
<p><a href="/docs/next/check-api.html#checkfields-message">Prefer using <code>check()</code> instead</a>. This function has been deprecated.</p>
72+
</blockquote>
7073
<p>Creates a sanitization chain for one or more fields. They may be located in any of the following request objects:</p>
7174
<ul>
7275
<li><code>req.body</code></li>
@@ -78,12 +81,24 @@ <h2><a class="anchor" aria-hidden="true" id="sanitizefields"></a><a href="#sanit
7881
<p>If any of the fields are present in more than one location, then all instances of that field value will be sanitized.</p>
7982
<h2><a class="anchor" aria-hidden="true" id="sanitizebodyfields"></a><a href="#sanitizebodyfields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitizeBody(fields)</code></h2>
8083
<p>Same as <code>sanitize(fields)</code>, but only sanitizing <code>req.body</code>.</p>
84+
<blockquote>
85+
<p><a href="/docs/next/check-api.html#bodyfields-message">Prefer using <code>body()</code> instead</a>. This function has been deprecated.</p>
86+
</blockquote>
8187
<h2><a class="anchor" aria-hidden="true" id="sanitizecookiefields"></a><a href="#sanitizecookiefields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitizeCookie(fields)</code></h2>
8288
<p>Same as <code>sanitize(fields)</code>, but only sanitizing <code>req.cookies</code>.</p>
89+
<blockquote>
90+
<p><a href="/docs/next/check-api.html#cookiefields-message">Prefer using <code>cookie()</code> instead</a>. This function has been deprecated.</p>
91+
</blockquote>
8392
<h2><a class="anchor" aria-hidden="true" id="sanitizeparamfields"></a><a href="#sanitizeparamfields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitizeParam(fields)</code></h2>
8493
<p>Same as <code>sanitize(fields)</code>, but only sanitizing <code>req.params</code>.</p>
94+
<blockquote>
95+
<p><a href="/docs/next/check-api.html#paramfields-message">Prefer using <code>param()</code> instead</a>. This function has been deprecated.</p>
96+
</blockquote>
8597
<h2><a class="anchor" aria-hidden="true" id="sanitizequeryfields"></a><a href="#sanitizequeryfields" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>sanitizeQuery(fields)</code></h2>
8698
<p>Same as <code>sanitize(fields)</code>, but only sanitizing <code>req.query</code>.</p>
99+
<blockquote>
100+
<p><a href="/docs/next/check-api.html#queryfields-message">Prefer using <code>query()</code> instead</a>. This function has been deprecated.</p>
101+
</blockquote>
87102
<h2><a class="anchor" aria-hidden="true" id="buildsanitizefunctionlocations"></a><a href="#buildsanitizefunctionlocations" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code>buildSanitizeFunction(locations)</code></h2>
88103
<ul>
89104
<li><code>locations</code>: an array of request locations to gather data from.<br>
@@ -92,6 +107,9 @@ <h2><a class="anchor" aria-hidden="true" id="buildsanitizefunctionlocations"></a
92107
<blockquote>
93108
<p><em>Returns:</em> a variant of <a href="#sanitizefields"><code>sanitize()</code></a> sanitizing the given request locations.</p>
94109
</blockquote>
110+
<blockquote>
111+
<p><a href="/docs/next/check-api.html#buildcheckfunctionlocations">Prefer using <code>buildCheckFunction()</code> instead</a>. This function has been deprecated.</p>
112+
</blockquote>
95113
<p>Creates a variant of <a href="#sanitizefields"><code>sanitize()</code></a> that sanitizes the given request locations.</p>
96114
<pre><code class="hljs css language-js"><span class="hljs-keyword">const</span> { buildSanitizeFunction } = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express-validator'</span>);
97115
<span class="hljs-keyword">const</span> sanitizeBodyAndQuery = buildSanitizeFunction([<span class="hljs-string">'body'</span>, <span class="hljs-string">'query'</span>]);

0 commit comments

Comments
 (0)