lux-utils
Version:
JS library to validate and format common Luxembourgish administrative data.
1,039 lines (336 loc) • 14.4 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>LuxUtils - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="LuxUtils.html">LuxUtils</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="LuxUtils.html#.validateCodePostal">validateCodePostal</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="LuxUtils.html#.validateFixedPhone">validateFixedPhone</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="LuxUtils.html#.validateFixedPhone">validateFixedPhone</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="LuxUtils.html#.validateLicensePlate">validateLicensePlate</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="LuxUtils.html#.validateMatricule">validateMatricule</a></span></li>
</nav>
<div id="main">
<h1 class="page-title">LuxUtils</h1>
<section>
<header>
<h2>
LuxUtils
</h2>
</header>
<article>
<div class="container-overview">
<div class="section-method">
<h4 class="name" id="LuxUtils"><span class="type-signature"></span>new LuxUtils<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>JS library to validate and format common Luxembourgish administrative data.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
</div>
</div>
<h3 class="subsection-title">Methods</h3>
<div class="section-method">
<h4 class="name" id=".validateCodePostal"><span class="type-signature">(static) </span>validateCodePostal<span class="signature">(codePostalToValidate)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
<p>Returns <code>true</code> if the given postal code is valid</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="validateCodePostal_index.js.html">validateCodePostal/index.js</a>, <a href="validateCodePostal_index.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>codePostalToValidate</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
|
<span class="param-type"><code>integer</code></span>
</td>
<td class="description last">
<p>postal code to validate. Can be a <code>string</code> or a <code>integer</code></p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>boolean</code></span>
</dd>
</dl>
<div class="param-desc">
<p><code>true</code> or <code>false</code></p>
</div>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>// validate a postal code
let isValid = LuxUtils.validateCodePostal(4402); //true;
let isValid2 = LuxUtils.validateCodePostal("L-4402"); //true;
let isValid3 = LuxUtils.validateCodePostal("0404"); //false;</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".validateFixedPhone"><span class="type-signature">(static) </span>validateFixedPhone<span class="signature">(fixedPhoneNumber)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
<p>Returns <code>true</code> if the fixed phone number is valid</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="validateFixedPhone_index.js.html">validateFixedPhone/index.js</a>, <a href="validateFixedPhone_index.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fixedPhoneNumber</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
|
<span class="param-type"><code>integer</code></span>
</td>
<td class="description last">
<p>fixed phone number to validate. Can be a <code>string</code> or a <code>integer</code></p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>boolean</code></span>
</dd>
</dl>
<div class="param-desc">
<p><code>true</code> or <code>false</code></p>
</div>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>// validate a postal code
let isValid = LuxUtils.validateFixedPhone(420288); //true;
let isValid2 = LuxUtils.validateFixedPhone("44 12 34 22"); //true;
let isValid3 = LuxUtils.validateFixedPhone("4444"); //false;</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".validateFixedPhone"><span class="type-signature">(static) </span>validateFixedPhone<span class="signature">(fixedPhoneNumber)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
<p>Returns <code>true</code> if the fixed phone number is valid</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="validateMobilePhone_index.js.html">validateMobilePhone/index.js</a>, <a href="validateMobilePhone_index.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>fixedPhoneNumber</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
|
<span class="param-type"><code>integer</code></span>
</td>
<td class="description last">
<p>fixed phone number to validate. Can be a <code>string</code>
or a <code>integer</code></p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>boolean</code></span>
</dd>
</dl>
<div class="param-desc">
<p><code>true</code> or <code>false</code></p>
</div>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>// validate a postal code
let isValid = LuxUtils.validateFixedPhone(420288); //true;
let isValid2 = LuxUtils.validateFixedPhone("44 12 34 22"); //true;
let isValid3 = LuxUtils.validateFixedPhone("4444"); //false;</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".validateLicensePlate"><span class="type-signature">(static) </span>validateLicensePlate<span class="signature">(licensePlateToValidate)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
<p>Returns <code>true</code> if the given postal code is valid</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="validateLicensePlate_index.js.html">validateLicensePlate/index.js</a>, <a href="validateLicensePlate_index.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>licensePlateToValidate</code></td>
<td class="type">
<span class="param-type"><code>string</code></span>
|
<span class="param-type"><code>integer</code></span>
</td>
<td class="description last">
<p>postal code to validate. Can be a <code>string</code> or a <code>integer</code></p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>boolean</code></span>
</dd>
</dl>
<div class="param-desc">
<p><code>true</code> or <code>false</code></p>
</div>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>// validate a postal code
let isValid = LuxUtils.validateLicensePlate(4402); //true;
let isValid2 = LuxUtils.validateLicensePlate("L-4402"); //true;
let isValid3 = LuxUtils.validateLicensePlate("0404"); //false;</code></pre>
</div>
</div>
<div class="section-method">
<h4 class="name" id=".validateMatricule"><span class="type-signature">(static) </span>validateMatricule<span class="signature">(matriculeToValidate)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
<p>Returns <code>true</code> if the matricule is valid</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="validateMatricule_index.js.html">validateMatricule/index.js</a>, <a href="validateMatricule_index.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>matriculeToValidate</code></td>
<td class="type">
<span class="param-type"><code>integer</code></span>
</td>
<td class="description last">
<p>matricule to validate</p>
</td>
</tr>
</tbody>
</table>
<div class="section-returns">
<h5>Returns:</h5>
<dl class="param-type">
<dt>
Type:
</dt>
<dd>
<span class="param-type"><code>boolean</code></span>
</dd>
</dl>
<div class="param-desc">
<p><code>true</code> or <code>false</code></p>
</div>
</div>
<div class="section-examples">
<h5>Example</h5>
<pre class="prettyprint"><code>// validate a matricule
let isValid = LuxUtils.validateMatricule(1893120105732); //true;</code></pre>
</div>
</div>
</article>
</section>
</div>
<br class="clear">
<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Feb 17 2019 22:52:22 GMT+0000 (WET) using the Minami theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>