Merge pull request #30897 from BendingBender/timing-safe-equal

Add types for timing-safe-equal
This commit is contained in:
Nathan Shively-Sanders
2018-11-30 09:26:32 -08:00
committed by GitHub
4 changed files with 39 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
// Type definitions for timing-safe-equal 1.0
// Project: https://github.com/crypto-browserify/timing-safe-equal
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export = timingSafeEqual;
declare function timingSafeEqual(a: Buffer, b: Buffer): boolean;
@@ -0,0 +1,5 @@
import timingSafeEqual = require('timing-safe-equal');
const buffer: Buffer = new Buffer([1, 2, 3, 4, 5]);
// $ExpectType boolean
timingSafeEqual(buffer, buffer);
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"timing-safe-equal-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }