Compare commits
5 Commits
main
...
7f44ad402b
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f44ad402b | |||
| 6ade51fb73 | |||
| 6ba90a7851 | |||
| 97ef6c798e | |||
| 0cea262ac5 |
28
licenses.md
28
licenses.md
@@ -1,3 +1,31 @@
|
|||||||
|
# validator
|
||||||
|
**Author**: Chris O'Hara <cohara87@gmail.com>
|
||||||
|
**Repo**: https://github.com/chriso/validator.js
|
||||||
|
**License**: MIT
|
||||||
|
**Description**: String validation and sanitization
|
||||||
|
## License Text
|
||||||
|
Copyright (c) 2018 Chris O'Hara <cohara87@gmail.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
# @odit/license-exporter
|
# @odit/license-exporter
|
||||||
**Author**: ODIT.Services
|
**Author**: ODIT.Services
|
||||||
**Repo**: https://git.odit.services/odit/license-exporter
|
**Repo**: https://git.odit.services/odit/license-exporter
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
"vite": "^2.1.2",
|
"vite": "^2.1.2",
|
||||||
"vite-plugin-windicss": "^0.9.2"
|
"vite-plugin-windicss": "^0.9.2"
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"validator": "^13.5.2"
|
||||||
|
},
|
||||||
"release-it": {
|
"release-it": {
|
||||||
"git": {
|
"git": {
|
||||||
"commit": true,
|
"commit": true,
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import isURL from "validator/lib/isURL";
|
||||||
|
import isUUID from "validator/lib/isUUID";
|
||||||
import { apikey, lang, stationinfo, api_endpoint } from "./store.js";
|
import { apikey, lang, stationinfo, api_endpoint } from "./store.js";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { _, locale } from "svelte-i18n";
|
import { _, locale } from "svelte-i18n";
|
||||||
@@ -10,30 +12,7 @@
|
|||||||
token?.length === 44 &&
|
token?.length === 44 &&
|
||||||
token.split(".")[0].length === 7 &&
|
token.split(".")[0].length === 7 &&
|
||||||
isUUID(token.split(".")[1]);
|
isUUID(token.split(".")[1]);
|
||||||
$: isEndpointValid = validURL(api_endpoint_input);
|
$: isEndpointValid = isURL(api_endpoint_input);
|
||||||
function validURL(str) {
|
|
||||||
var pattern = new RegExp(
|
|
||||||
"^(https?:\\/\\/)?" + // protocol
|
|
||||||
"((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name
|
|
||||||
"((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address
|
|
||||||
"(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path
|
|
||||||
"(\\?[;&a-z\\d%_.~+=-]*)?" + // query string
|
|
||||||
"(\\#[-a-z\\d_]*)?$",
|
|
||||||
"i"
|
|
||||||
); // fragment locator
|
|
||||||
return !!pattern.test(str);
|
|
||||||
}
|
|
||||||
function isUUID(uuid) {
|
|
||||||
let s = "" + uuid;
|
|
||||||
|
|
||||||
s = s.match(
|
|
||||||
"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
|
|
||||||
);
|
|
||||||
if (s === null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="w-full flex flex-wrap">
|
<div class="w-full flex flex-wrap">
|
||||||
|
|||||||
Reference in New Issue
Block a user