@types/jstoxml
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -14,3 +14,3 @@ // Type definitions for jstoxml 2.0 | ||
*/ | ||
_name?: string; | ||
_name?: string | undefined; | ||
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
_attrs?: XmlAttrs | XmlAttrs[]; | ||
_attrs?: XmlAttrs | XmlAttrs[] | undefined; | ||
@@ -26,3 +26,3 @@ /** | ||
*/ | ||
_content?: XmlElement | XmlElement[] | unknown; | ||
_content?: XmlElement | XmlElement[] | unknown | undefined; | ||
@@ -40,3 +40,3 @@ /** | ||
*/ | ||
depth?: number; | ||
depth?: number | undefined; | ||
@@ -47,3 +47,3 @@ /** | ||
*/ | ||
indent?: string; | ||
indent?: string | undefined; | ||
@@ -55,3 +55,3 @@ /** | ||
*/ | ||
header?: string | boolean; | ||
header?: string | boolean | undefined; | ||
@@ -61,3 +61,3 @@ /** | ||
*/ | ||
filter?: { [char: string]: string }; | ||
filter?: { [char: string]: string } | undefined; | ||
@@ -77,3 +77,3 @@ /** | ||
*/ | ||
attributesFilter?: {}; | ||
attributesFilter?: {} | undefined; | ||
@@ -84,3 +84,3 @@ /** | ||
*/ | ||
_selfCloseTag?: boolean; | ||
_selfCloseTag?: boolean | undefined; | ||
} | ||
@@ -87,0 +87,0 @@ |
{ | ||
"name": "@types/jstoxml", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "TypeScript definitions for jstoxml", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jstoxml", | ||
"license": "MIT", | ||
@@ -22,4 +23,4 @@ "contributors": [ | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "e26ff6a05865264dde5528307aaca213fa742ebf6d62f074f7bfd8607fa85674", | ||
"typeScriptVersion": "3.5" | ||
"typesPublisherContentHash": "229254288c25fd29f441ee640118ba949d681fcca49f56378e49aceb217c67fb", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -9,5 +9,91 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jstoxml. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jstoxml/index.d.ts) | ||
````ts | ||
// Type definitions for jstoxml 2.0 | ||
// Project: http://github.com/davidcalhoun/jstoxml | ||
// Definitions by: Steven Snoeijen <https://github.com/stevensnoeijen> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
interface XmlAttrs { | ||
[name: string]: unknown; | ||
} | ||
export interface XmlElement { | ||
/** | ||
* Element's name | ||
*/ | ||
_name?: string | undefined; | ||
/** | ||
* Element's attributes. | ||
*/ | ||
_attrs?: XmlAttrs | XmlAttrs[] | undefined; | ||
/** | ||
* Element's content. | ||
*/ | ||
_content?: XmlElement | XmlElement[] | unknown | undefined; | ||
/** | ||
* Another way to create (sub)-elements (like in _content). | ||
*/ | ||
[key: string]: XmlElement | XmlElement[] | unknown; | ||
} | ||
export interface XmlOptions { | ||
/** | ||
* Tree depth. | ||
* @default 0 | ||
*/ | ||
depth?: number | undefined; | ||
/** | ||
* By default elements are intented with 1 whitespace per depth. | ||
* @default " " | ||
*/ | ||
indent?: string | undefined; | ||
/** | ||
* Set Custom XML header when given a string, | ||
* when setting to true the default xml header will be added. | ||
* @default false | ||
*/ | ||
header?: string | boolean | undefined; | ||
/** | ||
* Custom filter for XML entities. | ||
*/ | ||
filter?: { [char: string]: string } | undefined; | ||
/** | ||
* Custom filter for XML attributes | ||
* Default filters are: | ||
* @example | ||
* <code> | ||
* const defaultEntityFilter = { | ||
* "<": "<", | ||
* ">": ">", | ||
* "&": "&", | ||
* }; | ||
* </code> | ||
* Setting this to `false` disables attribute filters. | ||
*/ | ||
attributesFilter?: {} | undefined; | ||
/** | ||
* If for some reason you want to avoid self-closing tags, you can pass in a special config option _selfCloseTag. | ||
* @default true | ||
*/ | ||
_selfCloseTag?: boolean | undefined; | ||
} | ||
export function toXML(obj?: XmlElement | XmlElement[], options?: XmlOptions): string; | ||
// do not export every type by default | ||
export {}; | ||
```` | ||
### Additional Details | ||
* Last updated: Tue, 27 Apr 2021 06:31:33 GMT | ||
* Last updated: Thu, 08 Jul 2021 16:23:01 GMT | ||
* Dependencies: none | ||
@@ -14,0 +100,0 @@ * Global values: none |
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 website
QualityPackage does not have a website.
Found 1 instance in 1 package
6486
0
103