Created
November 14, 2021 04:08
-
-
Save jdanyow/a4f6c9b5854d10bcfe9c39f7345bcd10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>GistRun</title> | |
<script type="module"> | |
import { Validator } from 'https://cdn.jsdelivr.net/npm/@cfworker/[email protected]/dist/index.js'; | |
const validator = new Validator({ type: 'number' }); | |
let result = validator.validate(1); | |
document.body.insertAdjacentHTML('beforeend', `<pre><code>${JSON.stringify(result, null, 2)}</code></pre>`); | |
result = validator.validate('hello'); | |
document.body.insertAdjacentHTML('beforeend', `<pre><code>${JSON.stringify(result, null, 2)}</code></pre>`); | |
</script> | |
</head> | |
<body> | |
<h1>Hello world!</h1> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment