UNPKG

856 BJavaScriptView Raw
1'use strict';
2/**
3 * index module
4 * @module index
5 * @see module:index
6 */
7const lang = require('zero-lang');
8const xmldom = require('xmldom');
9const dom2js = require('./dom2js');
10const dom2json = require('./dom2json');
11const escape = require('./escape');
12const getInnerXML = require('./get-inner-xml');
13const js2xml = require('./js2xml');
14const json2xml = require('./json2xml');
15const sanitize = require('./sanitize');
16const unescape = require('./unescape');
17const xml = require('./xml');
18const xml2js = require('./xml2js');
19const xml2json = require('./xml2json');
20
21lang.extend(xml, {
22 ENV: 'node',
23 dom2js,
24 dom2json,
25 domParser: new xmldom.DOMParser(),
26 escape,
27 getInnerXML,
28 getOuterXML: xml.serialize,
29 js2xml,
30 json2xml,
31 sanitize,
32 unescape,
33 xml2js,
34 xml2json,
35 xmlSerializer: new xmldom.XMLSerializer(),
36});
37
38module.exports = xml;