@antora/playbook-builder
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -149,3 +149,6 @@ 'use strict' | ||
ensureGitSuffix: { | ||
doc: '(Deprecated; to be removed in Antora 3) Instructs the git client to automatically append .git to the repository URL if absent.', | ||
doc: [ | ||
'(Deprecated; to be removed in Antora 3)', | ||
'Instructs the git client to automatically append .git to the repository URL if absent.', | ||
].join(' '), | ||
format: Boolean, | ||
@@ -152,0 +155,0 @@ default: undefined, |
@@ -64,8 +64,15 @@ 'use strict' | ||
validate: (val) => { | ||
if (!(val && (typeof val === 'string' || val instanceof String) && val.charAt() === '/')) { | ||
if (typeof val === 'string' || val instanceof String) { | ||
if (val.charAt() === '/') val = 'https://example.org' + val | ||
let parsed | ||
try { | ||
new URL(val) // eslint-disable-line no-new | ||
parsed = new URL(val) | ||
} catch (e) { | ||
throw new Error('must be an absolute URL or a pathname (i.e., root-relative path)') | ||
} | ||
if (~parsed.pathname.indexOf('%20')) { | ||
throw new Error('must not contain spaces') | ||
} | ||
} else if (val) { | ||
throw new Error('must be an absolute URL or a pathname (i.e., root-relative path)') | ||
} | ||
@@ -72,0 +79,0 @@ }, |
{ | ||
"name": "@antora/playbook-builder", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Builds a playbook object from user input for configuring successive documentation components in an Antora pipeline.", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
14169
385