-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: updates types to be more accurate
- Loading branch information
1 parent
eeb4f7a
commit b988fc8
Showing
8 changed files
with
30 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* @poppinss/hash | ||
* @adonisjs/hash | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* @poppinss/hash | ||
* @adonisjs/hash | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* @poppinss/hash | ||
* @adonisjs/hash | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
|
@@ -10,15 +10,20 @@ | |
/// <reference path="../adonis-typings/hash.ts" /> | ||
|
||
import { Manager } from '@poppinss/manager' | ||
import { HashContract, HashDriverContract, HashConfigContract, HashList } from '@ioc:Adonis/Core/Hash' | ||
import { | ||
HashContract, | ||
HashDriverContract, | ||
HashConfigContract, | ||
HashList, | ||
} from '@ioc:Adonis/Core/Hash' | ||
|
||
/** | ||
* The Hash module exposes the API to hash values using an underlying | ||
* Hash driver. | ||
*/ | ||
export class Hash <Config extends HashConfigContract> | ||
extends Manager<HashDriverContract, { [P in keyof HashList]: HashList[P]['implementation'] }> | ||
implements HashContract | ||
implements HashContract<HashDriverContract> | ||
{ | ||
constructor (container: any, public config: Config) { | ||
super(container) | ||
|
@@ -69,7 +74,7 @@ export class Hash <Config extends HashConfigContract> | |
/** | ||
* Hash value using the default driver | ||
*/ | ||
public hash (value: string) { | ||
public hash (value: string): never | any { | ||
return this.use().hash(value) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
/* | ||
* @poppinss/hash | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* @adonisjs/hash | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
export { Hash } from './src/Hash' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* @poppinss/hash | ||
* @adonisjs/hash | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* @poppinss/hash | ||
* @adonisjs/hash | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* @poppinss/hash | ||
* @adonisjs/hash | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
|