Skip to content

Commit a75abc2

Browse files
committed
refactor(Form): improve jpath type check in XML parsing options
- Updated the isArray function to ensure jpath is a string before checking inclusion in paths, enhancing type safety and preventing potential errors during XML parsing.
1 parent 0a0bc46 commit a75abc2

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/sec/forms/Form.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66

77
// See https://www.sec.gov/files/edgar/filermanual/edgarfilermmanual-vol2-c3.pdf
88

9+
import { X2jOptions, XMLParser } from "fast-xml-parser";
910
import type { TObject } from "typebox";
10-
import { Readable } from "node:stream";
1111
import { extractArrayPaths } from "./parse_util";
12-
import { X2jOptions } from "fast-xml-parser";
13-
import { XMLParser } from "fast-xml-parser";
1412

1513
export abstract class Form {
1614
static readonly name: string;
@@ -34,7 +32,7 @@ export abstract class Form {
3432
parseTagValue: false,
3533
parseAttributeValue: false,
3634
isArray: (_name, jpath) => {
37-
return paths.includes(jpath);
35+
return typeof jpath === "string" && paths.includes(jpath);
3836
},
3937
};
4038
return new XMLParser(options);

0 commit comments

Comments
 (0)