ESM: Tidied up Rotate operations

This commit is contained in:
n1474335 2018-04-06 12:40:39 +00:00
parent af51090ebb
commit fad4713a90
6 changed files with 18 additions and 36 deletions

View file

@ -6,13 +6,6 @@
import Operation from "../Operation";
/**
* Default arguments for ROT13 operation
*/
const ROT13_AMOUNT = 13,
ROT13_LOWERCASE = true,
ROT13_UPPERCASE = true;
/**
* ROT13 operation.
@ -34,23 +27,23 @@ class ROT13 extends Operation {
{
name: "Rotate lower case chars",
type: "boolean",
value: ROT13_LOWERCASE
value: true
},
{
name: "Rotate upper case chars",
type: "boolean",
value: ROT13_UPPERCASE
value: true
},
{
name: "Amount",
type: "number",
value: ROT13_AMOUNT
value: 13
},
];
}
/**
* @param {string} input
* @param {byteArray} input
* @param {Object[]} args
* @returns {byteArray}
*/

View file

@ -6,11 +6,6 @@
import Operation from "../Operation";
/**
* Default argument for ROT47 operation
*/
const ROT47_AMOUNT = 47;
/**
* ROT47 operation.
@ -32,13 +27,13 @@ class ROT47 extends Operation {
{
name: "Amount",
type: "number",
value: ROT47_AMOUNT
value: 47
},
];
}
/**
* @param {string} input
* @param {byteArray} input
* @param {Object[]} args
* @returns {byteArray}
*/

View file

@ -5,7 +5,8 @@
*/
import Operation from "../Operation";
import { rot, rotl, rotlCarry, ROTATE_AMOUNT, ROTATE_CARRY } from "../lib/Rotate";
import {rot, rotl, rotlCarry} from "../lib/Rotate";
/**
* Rotate left operation.
@ -27,18 +28,18 @@ class RotateLeft extends Operation {
{
name: "Amount",
type: "number",
value: ROTATE_AMOUNT
value: 1
},
{
name: "Carry through",
type: "boolean",
value: ROTATE_CARRY
value: false
}
];
}
/**
* @param {string} input
* @param {byteArray} input
* @param {Object[]} args
* @returns {byteArray}
*/

View file

@ -5,7 +5,8 @@
*/
import Operation from "../Operation";
import { rot, rotr, rotrCarry, ROTATE_AMOUNT, ROTATE_CARRY } from "../lib/Rotate";
import {rot, rotr, rotrCarry} from "../lib/Rotate";
/**
* Rotate right operation.
@ -27,18 +28,18 @@ class RotateRight extends Operation {
{
name: "Amount",
type: "number",
value: ROTATE_AMOUNT
value: 1
},
{
name: "Carry through",
type: "boolean",
value: ROTATE_CARRY
value: false
}
];
}
/**
* @param {string} input
* @param {byteArray} input
* @param {Object[]} args
* @returns {byteArray}
*/