You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@azure/core-xml

Package Overview
Dependencies
Maintainers
2
Versions
350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/core-xml - npm Package Compare versions

Comparing version

to
1.5.1-alpha.20250718.3

14

dist/browser/xml.d.ts
import type { XmlOptions } from "./xml.common.js";
/**
* Converts given XML string into JSON
* @param str - String containing the XML content to be parsed into JSON
* @param opts - Options that govern the parsing of given xml string
* `includeRoot` indicates whether the root element is to be included or not in the output
*/
export declare function parseXML(str: string, opts?: XmlOptions): Promise<any>;
export declare function stringifyXML(content: unknown, opts?: XmlOptions): string;
/**
* Converts given JSON object to XML string
* @param obj - JSON object to be converted into XML string
* @param opts - Options that govern the XML building of given JSON object
* `rootName` indicates the name of the root element in the resulting XML
*/
export declare function stringifyXML(obj: unknown, opts?: XmlOptions): string;
//# sourceMappingURL=xml-browser.d.mts.map

@@ -26,2 +26,8 @@ // Copyright (c) Microsoft Corporation.

const parser = new DOMParser();
/**
* Converts given XML string into JSON
* @param str - String containing the XML content to be parsed into JSON
* @param opts - Options that govern the parsing of given xml string
* `includeRoot` indicates whether the root element is to be included or not in the output
*/
export function parseXML(str, opts = {}) {

@@ -146,3 +152,9 @@ var _a, _b, _c, _d, _e, _f;

const serializer = new XMLSerializer();
export function stringifyXML(content, opts = {}) {
/**
* Converts given JSON object to XML string
* @param obj - JSON object to be converted into XML string
* @param opts - Options that govern the XML building of given JSON object
* `rootName` indicates the name of the root element in the resulting XML
*/
export function stringifyXML(obj, opts = {}) {
var _a, _b, _c, _d, _e;

@@ -156,3 +168,3 @@ const updatedOptions = {

};
const dom = buildNode(content, updatedOptions.rootName, updatedOptions)[0];
const dom = buildNode(obj, updatedOptions.rootName, updatedOptions)[0];
return ('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +

@@ -159,0 +171,0 @@ serializer.serializeToString(dom).replace(/ xmlns=""/g, ""));

6

package.json
{
"name": "@azure/core-xml",
"version": "1.5.0",
"version": "1.5.1-alpha.20250718.3",
"description": "Core library for interacting with XML payloads",

@@ -76,4 +76,4 @@ "sdk-type": "client",

"devDependencies": {
"@azure/dev-tool": "^1.0.0",
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
"@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
"@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
"@types/node": "^20.0.0",

@@ -80,0 +80,0 @@ "@types/trusted-types": "^2.0.0",

Sorry, the diff of this file is not supported yet