Skip to content

Commit 52f012b

Browse files
committed
[CRYPTO]: removed unused import
Signed-off-by: ashish <[email protected]>
1 parent c603761 commit 52f012b

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

src/commands/crypto.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
import {Command, flags} from '@oclif/command'
22
import * as CryptoJS from 'crypto-js'
3-
import {JsonFormatter} from 'tslint/lib/formatters'
4-
5-
import Utilities from '../utilities/Utilities'
63
import Logger from '../utilities/Logger'
74
import Hash from './hash'
85

96
export default class Crypto extends Command {
107
static ENCRYPTION = 'encryption'
118
static DECRYPTION = 'decryption'
12-
139
static description = 'Encryption and Decryption functionality'
1410
static flags = {
1511
help: flags.help({char: 'h'}),
@@ -23,7 +19,6 @@ export default class Crypto extends Command {
2319
}
2420

2521
static args = [{name: 'string'}]
26-
2722
//need INPUT_STRING, TYPE_OF_CRYPTO , KEY, MODE
2823
async run() {
2924
const {args, flags} = this.parse(Crypto)
@@ -33,35 +28,25 @@ export default class Crypto extends Command {
3328

3429
this.checkParameters(flags,args)
3530
flags.encryption ? this.Encrypt(flags, args) : this.Decrypt(flags, args)
36-
3731
}
3832

3933
private Encrypt(flags: any, args:any) {
40-
4134
let crypto = this.getCryptoType(args.type)
42-
4335
Logger.info(this,`Encryption: ${flags.encryption.toUpperCase()}`)
44-
4536
// @ts-ignore // as crypto will never be undefined and reach here
4637
let encrypted: string = crypto.encrypt(args.string, flags.key, {
4738
mode: this.getCryptoMode(this,flags)
4839
}).toString()
49-
50-
//always add input to args
51-
5240
Logger.success(this,`${encrypted}`)
5341
}
5442

5543
private Decrypt(flags: any, args: any) {
5644
let crypto = this.getCryptoType(args.type)
57-
5845
Logger.info(this,`Decryption: ${flags.decryption.toUpperCase()}`)
59-
6046
// @ts-ignore // as crypto will never be undefined and reach here
6147
let decrypted: string = crypto.decrypt(args.string, flags.key, {
6248
mode: this.getCryptoMode(this,flags)
6349
}).toString(CryptoJS.enc.Utf8)
64-
6550
Logger.success(this,`${decrypted}`)
6651
}
6752

@@ -83,7 +68,6 @@ export default class Crypto extends Command {
8368
Logger.error(this,'Invalid or Unsupported Encryption/Decryption type')
8469
return undefined // will never reach here
8570
}
86-
8771
}
8872

8973
// to check required parameters passed or not

0 commit comments

Comments
 (0)