@nakafa/aksara-contracts 0.34.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  const LOWER_KEBAB_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
2
2
  const LOWER_KEBAB_PATH_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u;
3
- const HTTPS_URL_PATTERN = /^https:\/\/\S+$/u;
3
+ const WHITESPACE_PATTERN = /\s/u;
4
4
  /** Checks one lowercase kebab-case segment without owning its domain meaning. */
5
5
  export function isLowerKebab(value) {
6
6
  return LOWER_KEBAB_PATTERN.test(value);
@@ -11,5 +11,9 @@ export function isLowerKebabPath(value) {
11
11
  }
12
12
  /** Checks one whitespace-free absolute HTTPS source URL. */
13
13
  export function isHttpsUrl(value) {
14
- return HTTPS_URL_PATTERN.test(value);
14
+ if (WHITESPACE_PATTERN.test(value) || !URL.canParse(value)) {
15
+ return false;
16
+ }
17
+ const url = new URL(value);
18
+ return url.protocol === "https:" && url.hostname.length > 0;
15
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nakafa/aksara-contracts",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Schemas and verification contracts for Nakafa content releases.",
5
5
  "homepage": "https://github.com/nakafaai/aksara#readme",
6
6
  "license": "SEE LICENSE IN LICENSE",