Skip to content

Commit

Permalink
improve validation
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Sep 1, 2024
1 parent 4664114 commit 384221a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "screenshotone-validations",
"homepage": "https://screenshotone.com",
"version": "1.0.43",
"version": "1.0.44",
"description": "Validation schemes for the ScreenshotOne API requests.",
"repository": {
"type": "git",
Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const validUri = (value: string, helper: any) => {
try {
if (!value) {
return helper.message('"url" must be specified');
}

if (value.trim().length === 0 || value.trim() !== value) {
return helper.message('"url" must be specified without leading and trailing white spaces');
}

const u = new URL(value);
Expand Down

0 comments on commit 384221a

Please sign in to comment.