mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Create credential-tests.ts
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/// <reference path="credential.d.ts">
|
||||
|
||||
import * as credential from 'credential';
|
||||
|
||||
credential.hash('password', function(err: Error, hash: string) {
|
||||
if (err) console.error(err);
|
||||
else console.log(hash);
|
||||
});
|
||||
|
||||
const hash = '{}';
|
||||
const password = 'test';
|
||||
|
||||
credential.verify(hash, password, function(err: Error, isValid: boolean) {
|
||||
if (err) console.error(err);
|
||||
else console.log(isValid ? 'Password match' : 'Incorrect password');
|
||||
});
|
||||
Reference in New Issue
Block a user