From e0b9ed670598dd21f385ba4daeee30d8fab9f9bc Mon Sep 17 00:00:00 2001 From: Macide Celik Date: Tue, 29 Oct 2019 08:52:11 +0300 Subject: [PATCH] Delete EncodeText.mjs --- src/core/operations/EncodeText.mjs | 58 ------------------------------ 1 file changed, 58 deletions(-) delete mode 100644 src/core/operations/EncodeText.mjs diff --git a/src/core/operations/EncodeText.mjs b/src/core/operations/EncodeText.mjs deleted file mode 100644 index 8dd4d503..00000000 --- a/src/core/operations/EncodeText.mjs +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @author n1474335 [n1474335@gmail.com] - * @copyright Crown Copyright 2016 - * @license Apache-2.0 - */ - -import Operation from "../Operation.mjs"; -import cptable from "../vendor/js-codepage/cptable.js"; -import {IO_FORMAT} from "../lib/ChrEnc.mjs"; - -/** - * Encode text operation - */ -class EncodeText extends Operation { - - /** - * EncodeText constructor - */ - constructor() { - super(); - - this.name = "Encode text"; - this.module = "Encodings"; - this.description = [ - "Encodes text into the chosen character encoding.", - "

", - "Supported charsets are:", - "", - ].join("\n"); - this.infoURL = "https://wikipedia.org/wiki/Character_encoding"; - this.inputType = "string"; - this.outputType = "ArrayBuffer"; - this.args = [ - { - "name": "Encoding", - "type": "option", - "value": Object.keys(IO_FORMAT) - } - ]; - } - - /** - * @param {string} input - * @param {Object[]} args - * @returns {ArrayBuffer} - */ - run(input, args) { - const format = IO_FORMAT[args[0]]; - const encoded = cptable.utils.encode(format, input); - return new Uint8Array(encoded).buffer; - } - -} - - -export default EncodeText;