Skip to content

Commit

Permalink
Merge pull request #27 from dknight/version-2.0.0
Browse files Browse the repository at this point in the history
Forgoten files added
  • Loading branch information
dknight authored Jul 1, 2022
2 parents fb401a9 + 43e564f commit 52db956
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 7 deletions.
43 changes: 38 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ npm install isikukood

Download and include JS file into your HTML.
```html
<script src="isikukood.js"></script>
<script src="./dest/isikukood.js"></script>
```

Using ES Modules
```html
import {Isikukood} from './dest/isikukood.mjs';
```

## Usage
Usage example.
```javascript
Expand Down Expand Up @@ -58,13 +64,13 @@ var maleIk = Isikukood.generate({
<td>generate()</td>
<td>Static function generates a valid personal ID.</td>
<td>Object { gender: "male|female", birthDay: day, birthMonth: month, birthYear: year }.r Month are beginning from 1, eg. 1 is January, 2 is February etc.</td>
<td>String</td>
<td>string</td>
</tr>
<tr>
<td>getGender()</td>
<td>Get the gender of a person.</td>
<td>-</td>
<td>String</td>
<td>string</td>
</tr>
<tr>
<td>getBirthday()</td>
Expand All @@ -76,12 +82,39 @@ var maleIk = Isikukood.generate({
<td>getAge()</td>
<td>Get the birthday of a person in years.</td>
<td>-</td>
<td>Number</td>
<td>number</td>
</tr>
<tr>
<td>getControlNumber()</td>
<td>Gets the control number of personal ID</td>
<td>-</td>
<td>Number</td>
<td>number</td>
</tr>
<tr>
<td>parse()</td>
<td>Parses the code and return it's data as object.</td>
<td>-</td>
<td>object</td>
</tr>
</table>

## Development
Be sure that your [GNU Make](https://www.gnu.org/software/make/) software is installed on your system. Development commands are very simple.

### Everything
```sh
make
```

### Build
```sh
make build
```

### Test
```sh
make test
```

## License
[MIT License](https://mit-license.org/) 2022
2 changes: 1 addition & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h4>Validate personal Estonian ID</h4>
<output id="result" class="invalid"></output>
</form>

<script type="module" src="./dest/isikukood.min.js"></script>
<script src="./dest/isikukood.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const form = document.getElementById('form-personal-id');
Expand Down
2 changes: 1 addition & 1 deletion isikukood.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class Isikukood {
}

/**
* Parses the code and return it's data.
* Parses the code and return it's data as object.
* @param {string|number} [code]
* @return {PersonalData}
*/
Expand Down

0 comments on commit 52db956

Please sign in to comment.