From ea2b1855ff631fea3c574b033c0b750afb7ba768 Mon Sep 17 00:00:00 2001 From: Macide Celik Date: Mon, 28 Oct 2019 08:37:50 +0300 Subject: [PATCH] Delete BSONSerialise.mjs --- src/core/operations/BSONSerialise.mjs | 49 --------------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/core/operations/BSONSerialise.mjs diff --git a/src/core/operations/BSONSerialise.mjs b/src/core/operations/BSONSerialise.mjs deleted file mode 100644 index 6d33c6be..00000000 --- a/src/core/operations/BSONSerialise.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 serialise operation - */ -class BSONSerialise extends Operation { - - /** - * BSONSerialise constructor - */ - constructor() { - super(); - - this.name = "BSON serialise"; - 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 valid JSON."; - this.infoURL = "https://wikipedia.org/wiki/BSON"; - this.inputType = "string"; - this.outputType = "ArrayBuffer"; - this.args = []; - } - - /** - * @param {string} input - * @param {Object[]} args - * @returns {ArrayBuffer} - */ - run(input, args) { - if (!input) return new ArrayBuffer(); - - try { - const data = JSON.parse(input); - return bson.serialize(data).buffer; - } catch (err) { - throw new OperationError(err.toString()); - } - } - -} - -export default BSONSerialise;