mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
function tidy, add comments
This commit is contained in:
parent
fca4ed7013
commit
b8b98358d0
3 changed files with 119 additions and 69 deletions
|
@ -2,11 +2,14 @@
|
|||
* Node view for CyberChef.
|
||||
*
|
||||
* @author n1474335 [n1474335@gmail.com]
|
||||
* @copyright Crown Copyright 2017
|
||||
* @copyright Crown Copyright 2018
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
import "babel-polyfill";
|
||||
|
||||
import {wrap, help, decapitalise} from "./apiUtils";
|
||||
import * as operations from "../core/operations/index";
|
||||
|
||||
// Define global environment functions
|
||||
global.ENVIRONMENT_IS_WORKER = function() {
|
||||
return typeof importScripts === "function";
|
||||
|
@ -19,24 +22,13 @@ global.ENVIRONMENT_IS_WEB = function() {
|
|||
};
|
||||
|
||||
|
||||
import wrap from "./Wrapper";
|
||||
|
||||
import * as operations from "../core/operations/index";
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
*/
|
||||
function decapitalise(name) {
|
||||
return `${name.charAt(0).toLowerCase()}${name.substr(1)}`;
|
||||
}
|
||||
|
||||
|
||||
// console.log(operations);
|
||||
const chef = {};
|
||||
|
||||
// Add in wrapped operations with camelCase names
|
||||
Object.keys(operations).forEach(op =>
|
||||
chef[decapitalise(op)] = wrap(operations[op]));
|
||||
|
||||
chef.help = help.bind(null, operations);
|
||||
|
||||
export default chef;
|
||||
export {chef};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue