Skip to content

Commit

Permalink
adding array type to the methods that might return an array
Browse files Browse the repository at this point in the history
  • Loading branch information
ifm-slang committed Sep 21, 2022
1 parent 9d58a40 commit b14e2d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/xml2js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class Xml2js {
/**
* Convert an xmlrpc value (as an xml tree) to a javascript object.
*/
convert(input:Node):Object|null {
convert(input:Node):Object|any[]|null {
const elt = this.helper.selectSingleNode(input, './*')
if (!elt)
return null
Expand Down
3 changes: 2 additions & 1 deletion src/lib/xmlrpc.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ export class XmlrpcService {
* - undefined: for empty response
* - null: for 'nil' value
* - Object: the value as an Object
* - any[]: if the value was an Array
*
* @throws {@link Error} on fault response (or unexpected server error)
*/
parseResponse(response:string):Object|null|undefined {
parseResponse(response:string):Object|any[]|null|undefined {
const doc = this.helper.loadXml(response)
const rootNode = doc.firstChild
if (!rootNode)
Expand Down

0 comments on commit b14e2d6

Please sign in to comment.