@tak-ps/node-cot 12.36.0 → 13.0.0

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.
@@ -9,6 +9,7 @@ import StreamZip from 'node-stream-zip'
9
9
  import { Readable } from 'node:stream';
10
10
  import { randomUUID } from 'node:crypto';
11
11
  import CoT from './cot.js';
12
+ import { CoTParser } from './parser.js';
12
13
  import xmljs from 'xml-js';
13
14
  import os from 'node:os';
14
15
  import fs from 'node:fs';
@@ -332,7 +333,7 @@ export class DataPackage {
332
333
  if (path.parse(content._attributes.zipEntry).ext !== '.cot') continue;
333
334
  if (opts.respectIgnore && content._attributes.ignore) continue;
334
335
 
335
- const cot = new CoT(await fsp.readFile(this.path + '/raw/' + content._attributes.zipEntry));
336
+ const cot = CoTParser.from_xml(await fsp.readFile(this.path + '/raw/' + content._attributes.zipEntry));
336
337
 
337
338
  cotsMap.set(cot.uid(), cot);
338
339
 
@@ -517,7 +518,7 @@ export class DataPackage {
517
518
 
518
519
  this.#addContent(`${cot.raw.event._attributes.uid}/${cot.raw.event._attributes.uid}.cot`, cot.raw.event._attributes.uid, name, opts.ignore);
519
520
  await fsp.mkdir(`${this.path}/raw/${cot.raw.event._attributes.uid}/`, { recursive: true });
520
- await fsp.writeFile(`${this.path}/raw/${cot.raw.event._attributes.uid}/${cot.raw.event._attributes.uid}.cot`, cot.to_xml())
521
+ await fsp.writeFile(`${this.path}/raw/${cot.raw.event._attributes.uid}/${cot.raw.event._attributes.uid}.cot`, CoTParser.to_xml(cot))
521
522
  }
522
523
 
523
524
  /**