diff --git a/README.md b/README.md index 07c182f2..26913c36 100644 --- a/README.md +++ b/README.md @@ -124,7 +124,7 @@ For available options see [options](#options). Usage: ```sh javascript-obfuscator in.js [options] -javascript-obfuscator in.js -output out.js [options] +javascript-obfuscator in.js --output out.js [options] ``` If the destination path is not specified through `--output` option, obfuscated code will saved into input file directory with name like `INPUT_FILE_NAME-obfuscated.js` diff --git a/src/storages/ArrayStorage.ts b/src/storages/ArrayStorage.ts index 030e462e..b98f3b62 100644 --- a/src/storages/ArrayStorage.ts +++ b/src/storages/ArrayStorage.ts @@ -45,6 +45,7 @@ export abstract class ArrayStorage implements IStorage { */ public getKeyOf (value: T): number | null { const key: number = this.storage.indexOf(value); + return key >= 0 ? key : null; }