Skip to content

Commit 333a872

Browse files
committed
Deploy website
Deploy website version based on 27e1ee3875e73e33cc31707d8b6fbb2be21fae40
1 parent c85311a commit 333a872

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

docs/next/custom-error-messages.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,15 @@ <h2><a class="anchor" aria-hidden="true" id="dynamic-messages"></a><a href="#dyn
145145
});
146146
</code></pre>
147147
<!-- prettier-ignore-end -->
148-
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/next/custom-validators-sanitizers.html"><span class="arrow-prev"></span><span>Custom validators/sanitizers</span></a><a class="docs-next button" href="/docs/next/wildcards.html"><span>Wildcards</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#error-message-levels">Error message levels</a><ul class="toc-headings"><li><a href="#validator-level">Validator Level</a></li><li><a href="#custom-validator-level">Custom Validator Level</a></li><li><a href="#field-level">Field Level</a></li></ul></li><li><a href="#dynamic-messages">Dynamic messages</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/logo.svg" alt="express-validator" width="66" height="58"/></a><div><h5>Docs</h5><a href="/docs/index.html">Getting Started</a><a href="/docs/check-api.html">API Reference</a></div><div><h5>Community</h5><a href="http://stackoverflow.com/questions/tagged/express-validator" target="_blank" rel="noreferrer noopener">Stack Overflow</a></div><div><h5>More</h5><a href="https://github.com/express-validator/express-validator">GitHub</a><a class="github-button" href="https://github.com/express-validator/express-validator" data-icon="octicon-star" data-count-href="/express-validator/express-validator/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><section class="copyright">Copyright © 2020 express-validator</section></footer></div></body></html>
148+
<h2><a class="anchor" aria-hidden="true" id="complex-errors"></a><a href="#complex-errors" 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>Complex errors</h2>
149+
<p>Error messages can be more complex types than a simple <code>string</code>.<br>
150+
For example you can provide an object with multiple properties:</p>
151+
<!-- prettier-ignore-start -->
152+
<pre><code class="hljs css language-js"><span class="hljs-comment">// check(field, withMessage) and .withMessage() work the same</span>
153+
check(<span class="hljs-string">'email'</span>).isEmail().withMessage({
154+
<span class="hljs-attr">message</span>: <span class="hljs-string">'Not an email'</span>,
155+
<span class="hljs-attr">errorCode</span>: <span class="hljs-number">1</span>,
156+
})
157+
</code></pre>
158+
<!-- prettier-ignore-end -->
159+
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/next/custom-validators-sanitizers.html"><span class="arrow-prev"></span><span>Custom validators/sanitizers</span></a><a class="docs-next button" href="/docs/next/wildcards.html"><span>Wildcards</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#error-message-levels">Error message levels</a><ul class="toc-headings"><li><a href="#validator-level">Validator Level</a></li><li><a href="#custom-validator-level">Custom Validator Level</a></li><li><a href="#field-level">Field Level</a></li></ul></li><li><a href="#dynamic-messages">Dynamic messages</a></li><li><a href="#complex-errors">Complex errors</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/logo.svg" alt="express-validator" width="66" height="58"/></a><div><h5>Docs</h5><a href="/docs/index.html">Getting Started</a><a href="/docs/check-api.html">API Reference</a></div><div><h5>Community</h5><a href="http://stackoverflow.com/questions/tagged/express-validator" target="_blank" rel="noreferrer noopener">Stack Overflow</a></div><div><h5>More</h5><a href="https://github.com/express-validator/express-validator">GitHub</a><a class="github-button" href="https://github.com/express-validator/express-validator" data-icon="octicon-star" data-count-href="/express-validator/express-validator/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><section class="copyright">Copyright © 2020 express-validator</section></footer></div></body></html>

0 commit comments

Comments
 (0)