Switched from awesome-typescript-loader on ts-loader #2

This commit is contained in:
sanex3339
2020-01-20 01:15:56 +03:00
parent b7217a72c8
commit 50f7405375
9 changed files with 399 additions and 27243 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import type { Chance } from 'chance';
import type * as Chance from 'chance';
export interface IRandomGenerator {
/**
+16 -14
View File
@@ -254,25 +254,27 @@ export class StringArrayStorage extends MapStorage <string, IStringArrayStorageI
* @returns {IEncodedValue}
*/
private getEncodedValue (value: string): IEncodedValue {
let encodedValue: string;
let decodeKey: string | null = null;
switch (this.options.stringArrayEncoding) {
case StringArrayEncoding.Rc4:
decodeKey = this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys);
encodedValue = this.cryptUtils.btoa(this.cryptUtils.rc4(value, decodeKey));
case StringArrayEncoding.Rc4: {
const decodeKey: string = this.randomGenerator.getRandomGenerator().pickone(this.rc4Keys);
const encodedValue: string = this.cryptUtils.btoa(this.cryptUtils.rc4(value, decodeKey));
break;
return { encodedValue, decodeKey };
}
case StringArrayEncoding.Base64:
encodedValue = this.cryptUtils.btoa(value);
case StringArrayEncoding.Base64: {
const decodeKey: null = null;
const encodedValue: string = this.cryptUtils.btoa(value);
break;
return { encodedValue, decodeKey };
}
default:
encodedValue = value;
default: {
const decodeKey: null = null;
const encodedValue: string = value;
return { encodedValue, decodeKey };
}
}
return { encodedValue, decodeKey };
}
}