File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 1
- import util from 'util' ;
2
- import { parseString } from 'xml2js' ;
3
-
4
- const parseStringSync = util . promisify ( parseString ) ;
1
+ import { parseStringPromise } from 'xml2js' ;
5
2
6
3
export function parseXML ( string , options ) {
7
4
const encodeXml = string . replace ( / & / g, '&' ) ;
8
5
const defaultOptions = {
9
6
explicitArray : true ,
10
7
} ;
11
8
const mergedOptions = Object . assign ( defaultOptions , options ) ;
12
- return parseStringSync ( encodeXml , mergedOptions ) ;
9
+ return parseStringPromise ( encodeXml , mergedOptions ) ;
13
10
}
Original file line number Diff line number Diff line change 1
1
import { from } from 'rxjs' ;
2
- import util from 'util' ;
3
- import { parseString } from 'xml2js' ;
2
+ import { parseStringPromise } from 'xml2js' ;
4
3
5
- const parseStringSync = util . promisify ( parseString ) ;
6
4
7
5
export function parseXML ( string , options ) {
8
6
const encodeXml = string . replace ( / & / g, '&' ) ;
9
7
const defaultOptions = {
10
8
explicitArray : true ,
11
9
} ;
12
10
const mergedOptions = Object . assign ( defaultOptions , options ) ;
13
- return from ( parseStringSync ( encodeXml , mergedOptions ) ) ;
11
+ return from ( parseStringPromise ( encodeXml , mergedOptions ) ) ;
14
12
}
You can’t perform that action at this time.
0 commit comments