From d0ede6dcff54f96f0e0697098adfa12679b567db Mon Sep 17 00:00:00 2001 From: Macide Celik Date: Mon, 28 Oct 2019 08:34:25 +0300 Subject: [PATCH] Delete BSONDeserialise.mjs --- src/core/operations/BSONDeserialise.mjs | 49 ------------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/core/operations/BSONDeserialise.mjs diff --git a/src/core/operations/BSONDeserialise.mjs b/src/core/operations/BSONDeserialise.mjs deleted file mode 100644 index a21eaadd..00000000 --- a/src/core/operations/BSONDeserialise.mjs +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @author n1474335 [n1474335@gmail.com] - * @copyright Crown Copyright 2018 - * @license Apache-2.0 - */ - -import Operation from "../Operation.mjs"; -import bson from "bson"; -import OperationError from "../errors/OperationError.mjs"; - -/** - * BSON deserialise operation - */ -class BSONDeserialise extends Operation { - - /** - * BSONDeserialise constructor - */ - constructor() { - super(); - - this.name = "BSON deserialise"; - this.module = "BSON"; - this.description = "BSON is a computer data interchange format used mainly as a data storage and network transfer format in the MongoDB database. It is a binary form for representing simple data structures, associative arrays (called objects or documents in MongoDB), and various data types of specific interest to MongoDB. The name 'BSON' is based on the term JSON and stands for 'Binary JSON'.

Input data should be in a raw bytes format."; - this.infoURL = "https://wikipedia.org/wiki/BSON"; - this.inputType = "ArrayBuffer"; - this.outputType = "string"; - this.args = []; - } - - /** - * @param {ArrayBuffer} input - * @param {Object[]} args - * @returns {string} - */ - run(input, args) { - if (!input.byteLength) return ""; - - try { - const data = bson.deserialize(new Buffer(input)); - return JSON.stringify(data, null, 2); - } catch (err) { - throw new OperationError(err.toString()); - } - } - -} - -export default BSONDeserialise;