Convert backend code to ES modules
Bundling code now with Rollup for its flat bundling and tree shaking support. Front end code still goes through Webpack for browser support.
This commit is contained in:
1 parent
824639976f
commit
1e41c72d60
62 files changed
+718
-898
No files matched your search
+6
-9
@@ -18,11 +18,11 @@
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const libxmljs = require("libxmljs");
|
||||
import libxmljs from "libxmljs";
|
||||
import * as config from "./config";
|
||||
import { version as VERSION } from "../package.json";
|
||||
|
||||
const config = require("./config");
|
||||
|
||||
const SERVER_NAME = `GenieACS/${require("../package.json").version}`;
|
||||
const SERVER_NAME = `GenieACS/${VERSION}`;
|
||||
|
||||
const NAMESPACES = {
|
||||
"1.0": {
|
||||
@@ -518,7 +518,7 @@ function fault(xml) {
|
||||
return { faultCode, faultString, detail };
|
||||
}
|
||||
|
||||
function request(data, cwmpVersion, warn) {
|
||||
export function request(data, cwmpVersion, warn) {
|
||||
warnings = warn;
|
||||
|
||||
const rpc = {
|
||||
@@ -642,7 +642,7 @@ function createSoapEnv(cwmpVersion) {
|
||||
return env;
|
||||
}
|
||||
|
||||
function response(rpc) {
|
||||
export function response(rpc) {
|
||||
const headers = {
|
||||
Server: SERVER_NAME,
|
||||
SOAPServer: SERVER_NAME
|
||||
@@ -716,6 +716,3 @@ function response(rpc) {
|
||||
data: env.doc().toString(LIBXMLJS_SAVE_OPTIONS)
|
||||
};
|
||||
}
|
||||
|
||||
exports.request = request;
|
||||
exports.response = response;
|
||||
Reference in new issue
Block a user