Skip to content

Commit a27dd07

Browse files
committed
Parser improved; Comments allowed
1 parent 40cfd4b commit a27dd07

File tree

8 files changed

+4929
-4549
lines changed

8 files changed

+4929
-4549
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A JS module for data validation of complexly-structured-data.
88

99
```javascript
1010
<script type="module">
11-
import { DataValidator } from 'https://cdn.jsdelivr.net/gh/anshu-krishna/JS-Data-Validator-Advanced@1.0/src/data-validator-min.js';
11+
import { DataValidator } from 'https://cdn.jsdelivr.net/gh/anshu-krishna/JS-Data-Validator-Advanced@1.1/src/data-validator-min.js';
1212

1313
// Your code goes here
1414
</script>
@@ -50,19 +50,23 @@ import { DataValidator as DV } from './data-validator.js';
5050
const dv = (() => {
5151
try {
5252
return DV.New`
53-
string.split('.') => [
54-
base64 => json => {
55-
alg: string.allowed('HS256', 'HS512'),
53+
string.split('.') => [ /* Split into three parts; */
54+
base64 => json => { /* Convert from base64; Parse JSON; */
55+
alg: string.allowed('HS256', 'HS512'), /* Test for supported algo type */
5656
typ: string.allowed('JWT'),
5757
},
58-
base64 => json => {
59-
?exp: unsigned,
60-
?iat: unsigned,
61-
?nbf: unsigned,
62-
?name: ([..2..string,].join(' ')|string),
58+
base64 => json => { /* Convert from base64; Parse JSON; */
59+
?exp: unsigned, /* Optional exp */
60+
?iat: unsigned, /* Optional iat */
61+
?nbf: unsigned, /* Optional nbf */
62+
?name: ([..2..string,].join(' ')|string), /* Name can be:
63+
an array with first-name and last-name
64+
OR
65+
a string containing the full-name
66+
*/
6367
...
6468
},
65-
base64
69+
base64 /* Convert from base64; */
6670
]`;
6771
} catch (error) {
6872
console.error(error);

src/data-validator-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)