Converted all modules from CommonJS to ES6

This commit is contained in:
n1474335 2017-03-23 17:52:20 +00:00
parent 0f2a5014be
commit 131b3a83c1
75 changed files with 395 additions and 282 deletions

View file

@ -7,7 +7,7 @@
*
* @namespace
*/
var Base = module.exports = {
const Base = {
/**
* @constant
@ -50,3 +50,5 @@ var Base = module.exports = {
},
};
export default Base;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var Base58 = module.exports = {
const Base58 = {
/**
* @constant
@ -133,3 +133,5 @@ var Base58 = module.exports = {
},
};
export default Base58;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var Base64 = module.exports = {
const Base64 = {
/**
* @constant
@ -342,3 +342,5 @@ var Base64 = module.exports = {
},
};
export default Base64;

View file

@ -1,5 +1,5 @@
var Utils = require("../Utils.js"),
CryptoJS = require("crypto-js");
import Utils from "../Utils.js";
import CryptoJS from "crypto-js";
/**
@ -11,7 +11,7 @@ var Utils = require("../Utils.js"),
*
* @namespace
*/
var BitwiseOp = module.exports = {
const BitwiseOp = {
/**
* Runs bitwise operations across the input data.
@ -306,3 +306,5 @@ var BitwiseOp = module.exports = {
},
};
export default BitwiseOp;

View file

@ -1,5 +1,5 @@
/* globals app */
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -11,7 +11,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var ByteRepr = module.exports = {
const ByteRepr = {
/**
* @constant
@ -394,3 +394,5 @@ var ByteRepr = module.exports = {
},
};
export default ByteRepr;

View file

@ -1,5 +1,5 @@
var Utils = require("../Utils.js"),
CryptoJS = require("crypto-js");
import Utils from "../Utils.js";
import CryptoJS from "crypto-js";
/**
@ -11,7 +11,7 @@ var Utils = require("../Utils.js"),
*
* @namespace
*/
var CharEnc = module.exports = {
const CharEnc = {
/**
* @constant
@ -46,3 +46,5 @@ var CharEnc = module.exports = {
},
};
export default CharEnc;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var Checksum = module.exports = {
const Checksum = {
/**
* Fletcher-8 Checksum operation.
@ -191,3 +191,5 @@ var Checksum = module.exports = {
},
};
export default Checksum;

View file

@ -1,6 +1,6 @@
var Utils = require("../Utils.js"),
CryptoJS = require("crypto-js"),
Blowfish = require("sladex-blowfish");
import Utils from "../Utils.js";
import CryptoJS from "crypto-js";
import {blowfish as Blowfish} from "sladex-blowfish";
/**
@ -12,7 +12,7 @@ var Utils = require("../Utils.js"),
*
* @namespace
*/
var Cipher = module.exports = {
const Cipher = {
/**
* @constant
@ -617,6 +617,8 @@ var Cipher = module.exports = {
};
export default Cipher;
/**
* Overwriting the CryptoJS OpenSSL key derivation function so that it is possible to not pass a

View file

@ -1,8 +1,8 @@
var Utils = require("../Utils.js"),
VKbeautify = require("vkbeautify"),
dom = require("xmldom").DOMParser,
xpath = require("xpath"),
prettyPrintOne = require("exports-loader?prettyPrintOne!google-code-prettify/bin/prettify.min.js");
import Utils from "../Utils.js";
import vkbeautify from "vkbeautify";
import {DOMParser as dom} from "xmldom";
import xpath from "xpath";
import prettyPrintOne from "exports-loader?prettyPrintOne!google-code-prettify/bin/prettify.min.js";
/**
@ -14,7 +14,7 @@ var Utils = require("../Utils.js"),
*
* @namespace
*/
var Code = module.exports = {
const Code = {
/**
* @constant
@ -56,7 +56,7 @@ var Code = module.exports = {
*/
runXmlBeautify: function(input, args) {
var indentStr = args[0];
return VKbeautify.xml(input, indentStr);
return vkbeautify.xml(input, indentStr);
},
@ -70,7 +70,7 @@ var Code = module.exports = {
runJsonBeautify: function(input, args) {
var indentStr = args[0];
if (!input) return "";
return VKbeautify.json(input, indentStr);
return vkbeautify.json(input, indentStr);
},
@ -83,7 +83,7 @@ var Code = module.exports = {
*/
runCssBeautify: function(input, args) {
var indentStr = args[0];
return VKbeautify.css(input, indentStr);
return vkbeautify.css(input, indentStr);
},
@ -96,7 +96,7 @@ var Code = module.exports = {
*/
runSqlBeautify: function(input, args) {
var indentStr = args[0];
return VKbeautify.sql(input, indentStr);
return vkbeautify.sql(input, indentStr);
},
@ -115,7 +115,7 @@ var Code = module.exports = {
*/
runXmlMinify: function(input, args) {
var preserveComments = args[0];
return VKbeautify.xmlmin(input, preserveComments);
return vkbeautify.xmlmin(input, preserveComments);
},
@ -128,7 +128,7 @@ var Code = module.exports = {
*/
runJsonMinify: function(input, args) {
if (!input) return "";
return VKbeautify.jsonmin(input);
return vkbeautify.jsonmin(input);
},
@ -141,7 +141,7 @@ var Code = module.exports = {
*/
runCssMinify: function(input, args) {
var preserveComments = args[0];
return VKbeautify.cssmin(input, preserveComments);
return vkbeautify.cssmin(input, preserveComments);
},
@ -153,7 +153,7 @@ var Code = module.exports = {
* @returns {string}
*/
runSqlMinify: function(input, args) {
return VKbeautify.sqlmin(input);
return vkbeautify.sqlmin(input);
},
@ -423,3 +423,5 @@ var Code = module.exports = {
},
};
export default Code;

View file

@ -1,10 +1,10 @@
var Utils = require("../Utils.js"),
rawdeflate = require("zlibjs/bin/rawdeflate.min"),
rawinflate = require("zlibjs/bin/rawinflate.min"),
zlibAndGzip = require("zlibjs/bin/zlib_and_gzip.min"),
zip = require("zlibjs/bin/zip.min"),
unzip = require("zlibjs/bin/unzip.min"),
bzip2 = require("exports-loader?bzip2!../lib/bzip2.js");
import Utils from "../Utils.js";
import rawdeflate from "zlibjs/bin/rawdeflate.min";
import rawinflate from "zlibjs/bin/rawinflate.min";
import zlibAndGzip from "zlibjs/bin/zlib_and_gzip.min";
import zip from "zlibjs/bin/zip.min";
import unzip from "zlibjs/bin/unzip.min";
import bzip2 from "exports-loader?bzip2!../lib/bzip2.js";
var Zlib = {
RawDeflate: rawdeflate.Zlib.RawDeflate,
@ -27,7 +27,7 @@ var Zlib = {
*
* @namespace
*/
var Compress = module.exports = {
const Compress = {
/**
* @constant
@ -569,3 +569,5 @@ var Compress = module.exports = {
return Utils.displayFilesAsHTML(files);
},
};
export default Compress;

View file

@ -7,7 +7,7 @@
*
* @namespace
*/
var Convert = module.exports = {
const Convert = {
/**
* @constant
@ -410,3 +410,5 @@ var Convert = module.exports = {
},
};
export default Convert;

View file

@ -7,7 +7,7 @@
*
* @namespace
*/
var DateTime = module.exports = {
const DateTime = {
/**
* @constant
@ -448,5 +448,6 @@ var DateTime = module.exports = {
</tbody>\
</table>",
};
export default DateTime;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var Endian = module.exports = {
const Endian = {
/**
* @constant
@ -95,3 +95,5 @@ var Endian = module.exports = {
},
};
export default Endian;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var Entropy = module.exports = {
const Entropy = {
/**
* @constant
@ -167,3 +167,5 @@ var Entropy = module.exports = {
},
};
export default Entropy;

View file

@ -7,7 +7,7 @@
*
* @namespace
*/
var Extract = module.exports = {
const Extract = {
/**
* Runs search operations across the input data using regular expressions.
@ -295,3 +295,5 @@ var Extract = module.exports = {
},
};
export default Extract;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var FileType = module.exports = {
const FileType = {
/**
* Detect File Type operation.
@ -527,3 +527,5 @@ var FileType = module.exports = {
},
};
export default FileType;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var HTML = module.exports = {
const HTML = {
/**
* @constant
@ -851,3 +851,5 @@ var HTML = module.exports = {
},
};
export default HTML;

View file

@ -1,4 +1,4 @@
var UAParser = require("exports-loader?UAS_parser!../lib/uas_parser.js");
import {UAS_parser as UAParser} from "../lib/uas_parser.js";
/**
@ -10,7 +10,7 @@ var UAParser = require("exports-loader?UAS_parser!../lib/uas_parser.js");
*
* @namespace
*/
var HTTP = module.exports = {
const HTTP = {
/**
* Strip HTTP headers operation.
@ -52,3 +52,5 @@ var HTTP = module.exports = {
},
};
export default HTTP;

View file

@ -1,7 +1,7 @@
var Utils = require("../Utils.js"),
CryptoJS = require("crypto-js"),
CryptoApi = require("crypto-api"),
Checksum = require("./Checksum.js");
import Utils from "../Utils.js";
import CryptoJS from "crypto-js";
import CryptoApi from "crypto-api";
import Checksum from "./Checksum.js";
/**
@ -13,7 +13,7 @@ var Utils = require("../Utils.js"),
*
* @namespace
*/
var Hash = module.exports = {
const Hash = {
/**
* MD2 operation.
@ -385,3 +385,5 @@ var Hash = module.exports = {
},
};
export default Hash;

View file

@ -1,5 +1,5 @@
/* globals app */
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -11,7 +11,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var Hexdump = module.exports = {
const Hexdump = {
/**
* @constant
@ -198,3 +198,5 @@ var Hexdump = module.exports = {
},
};
export default Hexdump;

View file

@ -1,6 +1,6 @@
var Utils = require("../Utils.js"),
Checksum = require("./Checksum.js"),
BigInteger = require("jsbn").BigInteger;
import Utils from "../Utils.js";
import Checksum from "./Checksum.js";
import {BigInteger} from "jsbn";
/**
@ -12,7 +12,7 @@ var Utils = require("../Utils.js"),
*
* @namespace
*/
var IP = module.exports = {
const IP = {
/**
* @constant
@ -1060,5 +1060,6 @@ var IP = module.exports = {
255: {keyword: "Reserved", protocol: ""}
},
};
export default IP;

View file

@ -1,6 +1,6 @@
var esprima = require("esprima"),
escodegen = require("escodegen"),
esmangle = require("esmangle");
import esprima from "esprima";
import escodegen from "escodegen";
import esmangle from "esmangle";
/**
@ -12,7 +12,7 @@ var esprima = require("esprima"),
*
* @namespace
*/
var JS = module.exports = {
const JS = {
/**
* @constant
@ -160,3 +160,5 @@ var JS = module.exports = {
},
};
export default JS;

View file

@ -7,7 +7,7 @@
*
* @namespace
*/
var MAC = module.exports = {
const MAC = {
/**
* @constant
@ -86,3 +86,5 @@ var MAC = module.exports = {
},
};
export default MAC;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var MorseCode = module.exports = {
const MorseCode = {
/**
* @constant
@ -186,3 +186,5 @@ var MorseCode = module.exports = {
})(),
};
export default MorseCode;

View file

@ -7,7 +7,7 @@
*
* @namespace
*/
var NetBIOS = module.exports = {
const NetBIOS = {
/**
* @constant
@ -55,3 +55,5 @@ var NetBIOS = module.exports = {
},
};
export default NetBIOS;

View file

@ -4,7 +4,7 @@
* @author Unknown Male 282
* @namespace
*/
var Numberwang = module.exports = {
const Numberwang = {
/**
* Numberwang operation. Remain indoors.
@ -25,3 +25,5 @@ var Numberwang = module.exports = {
},
};
export default Numberwang;

View file

@ -7,7 +7,7 @@
*
* @namespace
*/
var OS = module.exports = {
const OS = {
/**
* Parse UNIX file permissions operation.
@ -307,3 +307,5 @@ var OS = module.exports = {
},
};
export default OS;

View file

@ -1,5 +1,5 @@
var Utils = require("../Utils.js"),
r = require("jsrsasign");
import Utils from "../Utils.js";
import * as r from "jsrsasign";
/**
@ -11,7 +11,7 @@ var Utils = require("../Utils.js"),
*
* @namespace
*/
var PublicKey = module.exports = {
const PublicKey = {
/**
* @constant
@ -336,6 +336,8 @@ var PublicKey = module.exports = {
};
export default PublicKey;
/**
* Overwrite X509.hex2dn function so as to join RDNs with a string which can be split on without

View file

@ -1,4 +1,4 @@
var punycode = require("punycode");
import punycode from "punycode";
/**
@ -10,7 +10,7 @@ var punycode = require("punycode");
*
* @namespace
*/
var Punycode = module.exports = {
const Punycode = {
/**
* @constant
@ -54,3 +54,5 @@ var Punycode = module.exports = {
},
};
export default Punycode;

View file

@ -30,7 +30,7 @@
*
* @namespace
*/
var QuotedPrintable = module.exports = {
const QuotedPrintable = {
/**
* To Quoted Printable operation.
@ -268,3 +268,5 @@ var QuotedPrintable = module.exports = {
},
};
export default QuotedPrintable;

View file

@ -9,7 +9,7 @@
*
* @todo Support for UTF16
*/
var Rotate = module.exports = {
const Rotate = {
/**
* @constant
@ -240,3 +240,5 @@ var Rotate = module.exports = {
},
};
export default Rotate;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var SeqUtils = module.exports = {
const SeqUtils = {
/**
* @constant
@ -221,3 +221,5 @@ var SeqUtils = module.exports = {
},
};
export default SeqUtils;

View file

@ -1,5 +1,5 @@
var Utils = require("../Utils.js"),
JsDiff = require("diff");
import Utils from "../Utils.js";
import JsDiff from "diff";
/**
@ -11,7 +11,7 @@ var Utils = require("../Utils.js"),
*
* @namespace
*/
var StrUtils = module.exports = {
const StrUtils = {
/**
* @constant
@ -538,3 +538,5 @@ var StrUtils = module.exports = {
},
};
export default StrUtils;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var Tidy = module.exports = {
const Tidy = {
/**
* @constant
@ -239,3 +239,5 @@ var Tidy = module.exports = {
},
};
export default Tidy;

View file

@ -1,5 +1,5 @@
/* globals unescape */
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -12,7 +12,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var URL_ = module.exports = {
const URL_ = {
/**
* @constant
@ -130,3 +130,5 @@ var URL_ = module.exports = {
},
};
export default URL_;

View file

@ -7,7 +7,7 @@
*
* @namespace
*/
var UUID = module.exports = {
const UUID = {
/**
* Generate UUID operation.
@ -37,3 +37,5 @@ var UUID = module.exports = {
},
};
export default UUID;

View file

@ -1,4 +1,4 @@
var Utils = require("../Utils.js");
import Utils from "../Utils.js";
/**
@ -10,7 +10,7 @@ var Utils = require("../Utils.js");
*
* @namespace
*/
var Unicode = module.exports = {
const Unicode = {
/**
* @constant
@ -63,3 +63,5 @@ var Unicode = module.exports = {
},
};
export default Unicode;