From 4d674decb2bd4a3d34ba1c441325ba48c7ea0634 Mon Sep 17 00:00:00 2001 From: Macide Celik Date: Tue, 29 Oct 2019 00:20:02 +0300 Subject: [PATCH] Delete DecodeText.mjs --- src/core/operations/DecodeText.mjs | 56 ------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 src/core/operations/DecodeText.mjs diff --git a/src/core/operations/DecodeText.mjs b/src/core/operations/DecodeText.mjs deleted file mode 100644 index 489e40d3..00000000 --- a/src/core/operations/DecodeText.mjs +++ /dev/null @@ -1,56 +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"; - -/** - * Decode text operation - */ -class DecodeText extends Operation { - - /** - * DecodeText constructor - */ - constructor() { - super(); - - this.name = "Decode text"; - this.module = "Encodings"; - this.description = [ - "Decodes text from the chosen character encoding.", - "

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