swap ENVIRONMENT_IS_* functions for Utils named exports

This commit is contained in:
d98762625 2019-07-05 10:17:52 +01:00
parent c70f14419a
commit 1c24c05647
41 changed files with 117 additions and 141 deletions

View file

@ -8,8 +8,9 @@
import Operation from "../Operation";
import OperationError from "../errors/OperationError";
import {BombeMachine} from "../lib/Bombe";
import {ROTORS, ROTORS_FOURTH, REFLECTORS, Reflector} from "../lib/Enigma";
import { isWorkerEnvironment } from "../Utils";
import { BombeMachine } from "../lib/Bombe";
import { ROTORS, ROTORS_FOURTH, REFLECTORS, Reflector } from "../lib/Enigma";
/**
* Bombe operation
@ -139,7 +140,7 @@ class Bombe extends Operation {
const ciphertext = input.slice(offset);
const reflector = new Reflector(reflectorstr);
let update;
if (ENVIRONMENT_IS_WORKER()) {
if (isWorkerEnvironment()) {
update = this.updateStatus;
} else {
update = undefined;