schema-markdown 1.2.5 → 1.2.6
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.
- package/lib/parser.js +5 -2
- package/lib/schema.js +1 -0
- package/package.json +5 -5
package/lib/parser.js
CHANGED
|
@@ -54,7 +54,8 @@ const rLineSplit = /\r?\n/;
|
|
|
54
54
|
* Parse Schema Markdown from a string or an iterator of strings
|
|
55
55
|
*
|
|
56
56
|
* @param {string|string[]} text - The Schema Markdown text
|
|
57
|
-
* @param {Object} [options
|
|
57
|
+
* @param {Object} [options = {}] - The options object
|
|
58
|
+
* @param {Object} [options.types={}] - The [type model]{@link https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'}
|
|
58
59
|
* @param {string} [options.filename=''] - The name of file being parsed (for error messages)
|
|
59
60
|
* @param {boolean} [options.validate=true] - If true, validate after parsing
|
|
60
61
|
* @returns {Object} The [type model]{@link https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'}
|
|
@@ -375,7 +376,8 @@ export function parseSchemaMarkdown(text, {types = {}, filename = '', validate =
|
|
|
375
376
|
|
|
376
377
|
// Duplicate URL?
|
|
377
378
|
if (urls.some((url) => url.method === actionUrl.method && url.path === actionUrl.path)) {
|
|
378
|
-
|
|
379
|
+
const paddedPath = 'path' in actionUrl ? ` ${actionUrl.path}` : '';
|
|
380
|
+
addError(`Duplicate URL: ${method}${paddedPath}`, filename, linenum);
|
|
379
381
|
}
|
|
380
382
|
|
|
381
383
|
// Add the URL
|
|
@@ -580,6 +582,7 @@ export class SchemaMarkdownParserError extends Error {
|
|
|
580
582
|
*/
|
|
581
583
|
constructor(errors) {
|
|
582
584
|
super(errors.join('\n'));
|
|
585
|
+
this.name = this.constructor.name;
|
|
583
586
|
this.errors = errors;
|
|
584
587
|
}
|
|
585
588
|
}
|
package/lib/schema.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "schema-markdown",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.6",
|
|
5
5
|
"description": "A schema definition and validation library",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"schema",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"test": "ava -v test/"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"ava": "~5.
|
|
28
|
-
"c8": "~7.
|
|
29
|
-
"eslint": "~8.
|
|
27
|
+
"ava": "~5.2",
|
|
28
|
+
"c8": "~7.13",
|
|
29
|
+
"eslint": "~8.40",
|
|
30
30
|
"jsdoc": "~4.0",
|
|
31
|
-
"jsdom": "~
|
|
31
|
+
"jsdom": "~22.0"
|
|
32
32
|
}
|
|
33
33
|
}
|