xml-toolkit 1.0.56 → 1.0.58
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/XMLMarshaller.js +2 -1
- package/lib/XMLSchemata.js +6 -0
- package/package.json +1 -1
package/lib/XMLMarshaller.js
CHANGED
package/lib/XMLSchemata.js
CHANGED
|
@@ -27,6 +27,8 @@ const XMLSchemata = class extends Map {
|
|
|
27
27
|
new XMLSchemaXml (this)
|
|
28
28
|
new XMLSchemaBuiltIn (this)
|
|
29
29
|
|
|
30
|
+
this.loadedFiles = new Set()
|
|
31
|
+
|
|
30
32
|
this.addFile (fn)
|
|
31
33
|
|
|
32
34
|
}
|
|
@@ -159,6 +161,10 @@ const XMLSchemata = class extends Map {
|
|
|
159
161
|
|
|
160
162
|
addFile (fn, options = {}) {
|
|
161
163
|
|
|
164
|
+
if (this.loadedFiles.has (fn)) return
|
|
165
|
+
|
|
166
|
+
this.loadedFiles.add (fn)
|
|
167
|
+
|
|
162
168
|
options.dirname = path.dirname (fn)
|
|
163
169
|
|
|
164
170
|
const document = this.parser.process (fs.readFileSync (fn, 'utf-8'))
|