@docusaurus/utils-validation
Advanced tools
Comparing version 2.0.0-alpha.64 to 2.0.0-alpha.65
@@ -41,3 +41,3 @@ "use strict"; | ||
exports.AdmonitionsSchema = Joi.object().default({}); | ||
exports.URISchema = Joi.alternatives(Joi.string().uri(), Joi.custom((val, helpers) => { | ||
exports.URISchema = Joi.alternatives(Joi.string().uri({ allowRelative: true }), Joi.custom((val, helpers) => { | ||
try { | ||
@@ -44,0 +44,0 @@ const url = new URL(val); |
{ | ||
"name": "@docusaurus/utils-validation", | ||
"version": "2.0.0-alpha.64", | ||
"version": "2.0.0-alpha.65", | ||
"description": "Node validation utility functions for Docusaurus packages", | ||
@@ -19,3 +19,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@docusaurus/utils": "2.0.0-alpha.64", | ||
"@docusaurus/utils": "2.0.0-alpha.65", | ||
"@hapi/joi": "17.1.1", | ||
@@ -27,3 +27,3 @@ "chalk": "^3.0.0" | ||
}, | ||
"gitHead": "5fdf3979c3595115109fc2e249ced846368c1f75" | ||
"gitHead": "deb65e2bd92a9b11fe067c7dc30b3d49b7828b5c" | ||
} |
@@ -112,12 +112,22 @@ /** | ||
test('URISchema', () => { | ||
const {testFail, testOK} = createTestHelpers({schema: URISchema}); | ||
const validURL = 'https://docusaurus.io'; | ||
const doubleHash = 'https://docusaurus.io#github#/:'; | ||
const invalidURL = 'invalidURL'; | ||
const invalidURL = 'spaces are invalid in a URL'; | ||
const relativeURL = 'relativeURL'; | ||
const relativeURLWithParent = '../relativeURLWithParent'; | ||
const urlFromIssue = 'https://riot.im/app/#/room/#ligo-public:matrix.org'; | ||
const {testFail, testOK} = createTestHelpers({schema: URISchema}); | ||
testOK(validURL); | ||
testOK(doubleHash); | ||
testFail(invalidURL); | ||
testOK(relativeURL); | ||
testOK(relativeURLWithParent); | ||
testOK(urlFromIssue); | ||
const protocolRelativeUrl1 = '//docusaurus.io/path'; | ||
const protocolRelativeUrl2 = '//docusaurus.io/docs/doc1#hash'; | ||
testOK(protocolRelativeUrl1); | ||
testOK(protocolRelativeUrl2); | ||
}); | ||
}); |
@@ -29,3 +29,3 @@ /** | ||
export const URISchema = Joi.alternatives( | ||
Joi.string().uri(), | ||
Joi.string().uri({allowRelative: true}), | ||
Joi.custom((val, helpers) => { | ||
@@ -32,0 +32,0 @@ try { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
470517
442
23
255
1
+ Added@docusaurus/utils@2.0.0-alpha.65(transitive)
- Removed@docusaurus/utils@2.0.0-alpha.64(transitive)