@gi.ts/parser
Advanced tools
Comparing version 1.2.0 to 1.4.0
import { GirXML } from "./xml"; | ||
export declare function parseGir(contents: string): Promise<GirXML>; | ||
export declare function parseGir(contents: string): GirXML; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseGir = void 0; | ||
const xml2js_1 = require("xml2js"); | ||
const util_1 = require("util"); | ||
// Promisify xml2js' parseString | ||
const parseStringAsync = async (str) => await util_1.promisify(xml2js_1.parseString)(str); | ||
async function parseGir(contents) { | ||
return await parseStringAsync(contents); | ||
const fast_xml_parser_1 = require("fast-xml-parser"); | ||
function parseGir(contents) { | ||
return fast_xml_parser_1.parse(contents, { | ||
attributeNamePrefix: "", | ||
attrNodeName: "$", | ||
ignoreAttributes: false, | ||
ignoreNameSpace: false, | ||
allowBooleanAttributes: true, | ||
parseNodeValue: true, | ||
parseAttributeValue: false, | ||
trimValues: true, | ||
arrayMode: true | ||
}); | ||
} | ||
exports.parseGir = parseGir; |
@@ -14,3 +14,3 @@ declare type Version = string; | ||
export interface GirXML { | ||
repository: Repository; | ||
repository: Repository[]; | ||
} | ||
@@ -17,0 +17,0 @@ export interface SourcePositionElement extends Element<SourcePosition> { |
{ | ||
"name": "@gi.ts/parser", | ||
"version": "1.2.0", | ||
"version": "1.4.0", | ||
"main": "dist/lib.js", | ||
@@ -23,9 +23,9 @@ "types": "dist/lib.d.ts", | ||
"dependencies": { | ||
"xml2js": "^0.4.22" | ||
"fast-xml-parser": "^3.17.5" | ||
}, | ||
"devDependencies": { | ||
"@types/xml2js": "^0.4.4", | ||
"typescript": "^4.1.0-dev.20201005" | ||
"typescript": "^4.1.0" | ||
}, | ||
"gitHead": "119aca66a2eea4511f0f2ccf05430343090bbc95" | ||
"gitHead": "a94a1cd0c94d8c42b284a57fe2a6c712dd2caace" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18130
574
+ Addedfast-xml-parser@^3.17.5
+ Addedfast-xml-parser@3.21.1(transitive)
+ Addedstrnum@1.0.5(transitive)
- Removedxml2js@^0.4.22
- Removedsax@1.4.1(transitive)
- Removedxml2js@0.4.23(transitive)
- Removedxmlbuilder@11.0.1(transitive)