cda-schematron-validator 1.1.7 → 1.1.8
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/README.md +5 -0
- package/lib/getSchematronMap.js +1 -1
- package/{parseSchematron.js → lib/parseSchematron.js} +0 -0
- package/package.json +13 -12
- package/validateAsync.js +2 -2
- package/validator.js +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
## Release History
|
|
4
4
|
|
|
5
|
+
### 1.1.8
|
|
6
|
+
|
|
7
|
+
- jsdoc module added
|
|
8
|
+
- parseSchematron.js moved to lib
|
|
9
|
+
|
|
5
10
|
### 1.1.7
|
|
6
11
|
|
|
7
12
|
- Introduced a new method called `validateFileObjectAsync` which allows to supply an object with key, value pairs where key represents the identifier of the xml, and the value represents xml file content or path to validate
|
package/lib/getSchematronMap.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const Dom = require('@xmldom/xmldom').DOMParser;
|
|
2
2
|
const crypto = require('crypto');
|
|
3
3
|
const _get = require('lodash.get');
|
|
4
|
-
const parseSchematron = require('
|
|
4
|
+
const parseSchematron = require('./parseSchematron');
|
|
5
5
|
/**
|
|
6
6
|
* @method getSchematronMap A method to get the schematron map from the provided schematron or utilize the data from cache or options object
|
|
7
7
|
* @param {string} schematron String data of schematron
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cda-schematron-validator",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Fork of Eric Wadkins' javascript implementation of schematron testing for C-CDA XML documents. This includes bug fixes and some house keeping.",
|
|
5
5
|
"main": "validator.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,21 +29,22 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/priyaranjan-tokachichu/cda-schematron-validator#readme",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"chai": "
|
|
32
|
+
"chai": "^4.3.6",
|
|
33
33
|
"eslint": "^8.12.0",
|
|
34
34
|
"eslint-config-google": "^0.14.0",
|
|
35
|
-
"grunt": "
|
|
36
|
-
"grunt-contrib-jshint": "
|
|
37
|
-
"grunt-mocha-test": "
|
|
38
|
-
"husky": "
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
35
|
+
"grunt": "^1.4.1",
|
|
36
|
+
"grunt-contrib-jshint": "^3.2.0",
|
|
37
|
+
"grunt-mocha-test": "^0.13.3",
|
|
38
|
+
"husky": "^7.0.4",
|
|
39
|
+
"jsdoc": "^3.6.10",
|
|
40
|
+
"lint-staged": "^12.3.7",
|
|
41
|
+
"mocha": "^9.2.2",
|
|
42
|
+
"prettier": "^2.6.2"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@xmldom/xmldom": "
|
|
45
|
-
"lodash.get": "
|
|
46
|
-
"xpath": "
|
|
45
|
+
"@xmldom/xmldom": "^0.7.2",
|
|
46
|
+
"lodash.get": "^4.4.2",
|
|
47
|
+
"xpath": "^0.0.32"
|
|
47
48
|
},
|
|
48
49
|
"directories": {
|
|
49
50
|
"test": "test"
|
package/validateAsync.js
CHANGED
|
@@ -54,7 +54,7 @@ async function validateAsync(xml, schematron, options = {}) {
|
|
|
54
54
|
/**
|
|
55
55
|
* @method validateFileListAsync Run the validateAsync method on each xml file of the array provided, and combine the results into an array and return it.
|
|
56
56
|
* It is important to know that the results could be in a different order than the submitted files. We can't reliably identify which error belongs to which file.
|
|
57
|
-
*
|
|
57
|
+
* The property `fileIndex` of each result object will provide the index of the xml data to which the error belongs to.
|
|
58
58
|
* @param {array} xmlArray array of string content of an xml file or path to an xml file
|
|
59
59
|
* @param {string} schematron string content of a schematron file or path to a schematron file
|
|
60
60
|
* @param {object} options object that takes parameters
|
|
@@ -83,7 +83,7 @@ async function validateFileListAsync(xmlArray, schematron, options = {}) {
|
|
|
83
83
|
/**
|
|
84
84
|
* @method validateFileObjectAsync Run the validateAsync method on each xml file of the xml data object provided, and combine the results into an array and return it.
|
|
85
85
|
* It is important to know that the results could be in a different order than the submitted files. We can't reliably identify which error belongs to which file.
|
|
86
|
-
*
|
|
86
|
+
* The property `fileInfo` of each result object will provide the information (probably an identifier or the name of the xml) the xml data to which the error belongs to.
|
|
87
87
|
* @param {object} xmlDataObject object with key identifying the xml and value to be the xml file data or xml file path
|
|
88
88
|
* @param {string} schematron string content of a schematron file or path to a schematron file
|
|
89
89
|
* @param {object} options object that takes parameters
|
package/validator.js
CHANGED
|
@@ -12,5 +12,5 @@ module.exports = {
|
|
|
12
12
|
validateFileObjectAsync: require('./validateAsync').validateFileObjectAsync,
|
|
13
13
|
clearCache: require('./validateSync').clearCache,
|
|
14
14
|
clearCacheAsync: require('./validateAsync').clearCache,
|
|
15
|
-
parseSchematron: require('./parseSchematron')
|
|
15
|
+
parseSchematron: require('./lib/parseSchematron')
|
|
16
16
|
};
|