You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
503 B
JavaScript
12 lines
503 B
JavaScript
"use strict";
|
|
|
|
const { validateValue } = require("@validatem/core");
|
|
const isHomeserverURL = require(".");
|
|
|
|
console.log(validateValue("https://pixie.town", [ isHomeserverURL() ])); // https://pixie.town
|
|
|
|
console.log(validateValue("https://pixie.town/_matrix", [ isHomeserverURL() ])); /*
|
|
AggregrateValidationError: One or more validation errors occurred at 'Object.<anonymous>' in is-homeserver-url/example.js, at line 8 (<path>):
|
|
- Must be a valid Matrix homeserver URL (Must not include a path)
|
|
*/
|