Skip to content

Commit

Permalink
refactor: remove _ prefix from private properties
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Dec 20, 2019
1 parent 9138d19 commit b801906
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Drivers/Argon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ export class Argon implements ArgonContract {
*/
public version = 19

constructor (private _config: ArgonConfigContract) {
constructor (private config: ArgonConfigContract) {
}

/**
* Hash a value using argon algorithm. The options can be used to override
* default settings.
*/
public hash (value: string): Promise<string> {
return argon2.hash(value, this._config)
return argon2.hash(value, this.config)
}

/**
Expand Down Expand Up @@ -83,15 +83,15 @@ export class Argon implements ArgonContract {
/**
* Variant mis-match
*/
if (deserialized.id !== `argon2${this._config.variant}`) {
if (deserialized.id !== `argon2${this.config.variant}`) {
return true
}

/**
* Check for params mis-match
*/
return !!Object.keys(this.params).find((key) => {
return deserialized.params[this.params[key]] !== this._config![key]
return deserialized.params[this.params[key]] !== this.config![key]
})
}
}
6 changes: 3 additions & 3 deletions src/Drivers/Bcrypt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ export class Bcrypt implements BcryptContract {
public params: BcryptContract['params'] = { rounds: 'r' }
public version = 98

constructor (private _config: BcryptConfigContract) {
constructor (private config: BcryptConfigContract) {
}

/**
* Returns hash for a given value
*/
public hash (value: string): Promise<string> {
return bcrypt.hash(value, this._config)
return bcrypt.hash(value, this.config)
}

/**
Expand All @@ -55,7 +55,7 @@ export class Bcrypt implements BcryptContract {
}

return !!Object.keys(this.params).find((key) => {
return deserialized.params[this.params[key]] !== this._config![key]
return deserialized.params[this.params[key]] !== this.config![key]
})
}

Expand Down
4 changes: 2 additions & 2 deletions src/Hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class Hash <Config extends HashConfigContract>
* Creating bcrypt driver. The manager will call this method anytime
* someone will ask for the `bcrypt` driver.
*/
protected createBcrypt (_mappingName: string, config: any) {
protected createBcrypt (_: string, config: any) {
const { Bcrypt } = require('./Drivers/Bcrypt')
return new Bcrypt(config)
}
Expand All @@ -65,7 +65,7 @@ export class Hash <Config extends HashConfigContract>
* Creating argon driver. The manager will call this method anytime
* someone will ask for the `argon` driver.
*/
protected createArgon2 (_mappingName: string, config: any) {
protected createArgon2 (_: string, config: any) {
const { Argon } = require('./Drivers/Argon')
return new Argon(config)
}
Expand Down

0 comments on commit b801906

Please sign in to comment.