@azure/core-xml
Advanced tools
Comparing version 1.0.0-beta.1 to 1.0.0
# Release History | ||
## 1.0.0 (2021-08-05) | ||
GA release of this package. | ||
## 1.0.0-beta.1 (2021-02-04) | ||
- First release of package. Exported XML helpers for client packages that need XML support, see README.md for details. |
@@ -5,3 +5,5 @@ // Copyright (c) Microsoft Corporation. | ||
import { XML_ATTRKEY, XML_CHARKEY } from "./xml.common"; | ||
// tslint:disable-next-line:no-null-keyword | ||
if (!document || !DOMParser || !Node || !XMLSerializer) { | ||
throw new Error(`This library depends on the following DOM objects: ["document", "DOMParser", "Node", "XMLSerializer"] to parse XML, but some of these are undefined. You may provide a polyfill to make these globally available in order to support your environment. For more information, please refer to https://aka.ms/azsdk/js/web-workers. `); | ||
} | ||
const doc = document.implementation.createDocument(null, null, null); | ||
@@ -37,4 +39,5 @@ const parser = new DOMParser(); | ||
try { | ||
errorNS = (_a = parser.parseFromString("INVALID", "text/xml").getElementsByTagName("parsererror")[0] | ||
.namespaceURI) !== null && _a !== void 0 ? _a : ""; | ||
errorNS = | ||
(_a = parser.parseFromString("INVALID", "text/xml").getElementsByTagName("parsererror")[0] | ||
.namespaceURI) !== null && _a !== void 0 ? _a : ""; | ||
} | ||
@@ -41,0 +44,0 @@ catch (ignored) { |
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// Licensed under the MIT license. | ||
/** | ||
@@ -4,0 +4,0 @@ * Default key used to access the XML attributes. |
@@ -60,4 +60,4 @@ // Copyright (c) Microsoft Corporation. | ||
* 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 | ||
* @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 | ||
@@ -74,4 +74,4 @@ */ | ||
* 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 | ||
* @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 | ||
@@ -78,0 +78,0 @@ */ |
@@ -8,3 +8,3 @@ 'use strict'; | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// Licensed under the MIT license. | ||
/** | ||
@@ -75,4 +75,4 @@ * Default key used to access the XML attributes. | ||
* 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 | ||
* @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 | ||
@@ -89,4 +89,4 @@ */ | ||
* 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 | ||
* @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 | ||
@@ -93,0 +93,0 @@ */ |
{ | ||
"name": "@azure/core-xml", | ||
"version": "1.0.0-beta.1", | ||
"version": "1.0.0", | ||
"description": "Core library for interacting with XML payloads", | ||
@@ -21,33 +21,25 @@ "sdk-type": "client", | ||
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", | ||
"build:browser": "npm run build:ts && cross-env ONLY_BROWSER=true rollup -c 2>&1", | ||
"build:node": "npm run build:ts && cross-env ONLY_NODE=true rollup -c 2>&1", | ||
"build:samples": "echo Skipped.", | ||
"build:test": "npm run build:ts && npm run bundle:test", | ||
"build:test:browser": "npm run build:ts && npm run bundle:test:browser", | ||
"build:test:node": "npm run build:ts && npm run bundle:test:node", | ||
"build:ts": "tsc -p .", | ||
"build:samples": "echo Obsolete", | ||
"build:test": "tsc -p . && rollup -c 2>&1", | ||
"build:types": "downlevel-dts types/latest/ types/3.1/", | ||
"build": "npm run build:ts && rollup -c 2>&1 && api-extractor run --local && npm run build:types", | ||
"bundle:test": "rollup -c rollup.test.config.js 2>&1", | ||
"bundle:test:browser": "cross-env ONLY_BROWSER=true rollup -c rollup.test.config.js 2>&1", | ||
"bundle:test:node": "cross-env ONLY_NODE=true rollup -c rollup.test.config.js 2>&1", | ||
"check-format": "prettier --list-different \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", | ||
"clean": "rimraf dist dist-* types *.tgz *.log", | ||
"build": "tsc -p . && rollup -c 2>&1 && api-extractor run --local && npm run build:types", | ||
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", | ||
"clean": "rimraf dist dist-* temp types *.tgz *.log", | ||
"docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src", | ||
"execute:samples": "echo skipped", | ||
"extract-api": "npm run build:ts && api-extractor run --local", | ||
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", | ||
"extract-api": "tsc -p . && api-extractor run --local", | ||
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"", | ||
"integration-test:browser": "echo skipped", | ||
"integration-test:node": "echo skipped", | ||
"integration-test": "npm run integration-test:node && npm run integration-test:browser", | ||
"lint:fix": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", | ||
"lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o coreXml-lintReport.html || exit 0", | ||
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]", | ||
"lint": "eslint package.json api-extractor.json src test --ext .ts", | ||
"pack": "npm pack 2>&1", | ||
"prebuild": "npm run clean", | ||
"test:browser": "npm run build:test:browser && npm run unit-test:browser && npm run integration-test:browser", | ||
"test:node": "npm run build:test:node && npm run unit-test:node && npm run integration-test:node", | ||
"test": "npm run clean && npm run build:ts && npm run bundle:test:node && npm run unit-test:node && npm run bundle:test:browser && npm run unit-test:browser && npm run integration-test:node && npm run integration-test:browser", | ||
"test:browser": "npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser", | ||
"test:node": "npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node", | ||
"test": "npm run clean && tsc -p . && npm run unit-test:node && rollup -c 2>&1 && npm run unit-test:browser && npm run integration-test", | ||
"unit-test:browser": "karma start --single-run", | ||
"unit-test:node": "mocha --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js dist-test/index.node.js", | ||
"unit-test": "npm run unit-test:node && npm run unit-test:browser", | ||
"docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src" | ||
"unit-test:node": "mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"", | ||
"unit-test": "npm run unit-test:node && npm run unit-test:browser" | ||
}, | ||
@@ -73,21 +65,17 @@ "files": [ | ||
"engines": { | ||
"node": ">=8.0.0" | ||
"node": ">=12.0.0" | ||
}, | ||
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/core/core-xml/", | ||
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-xml/", | ||
"sideEffects": false, | ||
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", | ||
"dependencies": { | ||
"tslib": "^2.0.0", | ||
"tslib": "^2.2.0", | ||
"xml2js": "^0.4.19" | ||
}, | ||
"devDependencies": { | ||
"@azure/dev-tool": "^1.0.0", | ||
"@microsoft/api-extractor": "7.7.11", | ||
"@rollup/plugin-commonjs": "11.0.2", | ||
"@rollup/plugin-json": "^4.0.0", | ||
"@rollup/plugin-multi-entry": "^3.0.0", | ||
"@rollup/plugin-node-resolve": "^8.0.0", | ||
"@rollup/plugin-replace": "^2.2.0", | ||
"@types/chai": "^4.1.6", | ||
"@types/mocha": "^7.0.2", | ||
"@types/node": "^8.0.0", | ||
"@types/node": "^12.0.0", | ||
"@types/sinon": "^9.0.4", | ||
@@ -101,3 +89,3 @@ "@types/xml2js": "^0.4.3", | ||
"inherits": "^2.0.3", | ||
"karma": "^5.1.0", | ||
"karma": "^6.2.0", | ||
"karma-chrome-launcher": "^3.0.0", | ||
@@ -118,7 +106,4 @@ "karma-coverage": "^2.0.0", | ||
"rollup": "^1.16.3", | ||
"rollup-plugin-sourcemaps": "^0.4.2", | ||
"rollup-plugin-terser": "^5.1.1", | ||
"rollup-plugin-visualizer": "^4.0.4", | ||
"sinon": "^9.0.2", | ||
"typescript": "4.1.2", | ||
"typescript": "~4.2.0", | ||
"util": "^0.12.1", | ||
@@ -125,0 +110,0 @@ "typedoc": "0.15.2" |
@@ -9,4 +9,9 @@ # Azure Core XML client library for JavaScript (Experimental) | ||
- [Node.js](https://nodejs.org) version > 8.x | ||
### Currently supported environments | ||
- [LTS versions of Node.js](https://nodejs.org/about/releases/) | ||
- Latest versions of Safari, Chrome, Edge, and Firefox. | ||
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. | ||
### Installation | ||
@@ -34,4 +39,4 @@ | ||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code. | ||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. | ||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-client%2FREADME.png) |
/** | ||
* 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 | ||
* @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 | ||
@@ -10,7 +10,7 @@ */ | ||
* 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 | ||
* @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: any, opts?: XmlOptions): string; | ||
export declare function stringifyXML(obj: unknown, opts?: XmlOptions): string; | ||
/** | ||
@@ -17,0 +17,0 @@ * Default key used to access the XML attributes. |
/** | ||
* 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 | ||
* @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 | ||
@@ -12,7 +12,7 @@ */ | ||
* 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 | ||
* @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: any, opts?: XmlOptions): string; | ||
export declare function stringifyXML(obj: unknown, opts?: XmlOptions): string; | ||
@@ -19,0 +19,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
49829
33
480
0
41
Updatedtslib@^2.2.0