Add Node types to dev dependencies

This commit is contained in:
Zaid Abdulla committed 2020-10-17 20:09:32 -07:00
1 parent 44a2fe11ee
commit 9f4b421b59
5 files changed
+23 -23

No files matched your search

+2 -1
View File
@@ -53,7 +53,8 @@ export interface Element {
}
export function parseXmlDeclaration(buffer: Buffer): Attribute[] {
for (const enc of ["utf16le", "utf8", "latin1", "ascii"]) {
const encodings: BufferEncoding[] = ["utf16le", "utf8", "latin1", "ascii"];
for (const enc of encodings) {
let str = buffer.toString(enc, 0, 150);
if (str.startsWith("<?xml")) {
str = str.split("\n")[0].trim();