minimalistic-assert: initial definition (#38765)

This commit is contained in:
Junxiao Shi
2019-10-02 14:52:56 -04:00
committed by Ryan Cavanaugh
parent 624778c4fa
commit 40b3fa23f6
4 changed files with 46 additions and 0 deletions

12
types/minimalistic-assert/index.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
// Type definitions for minimalistic-assert 1.0
// Project: https://github.com/calvinmetcalf/minimalistic-assert
// Definitions by: Junxiao Shi <https://github.com/yoursunny>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function assert(val: any, msg?: string): void;
declare namespace assert {
function equal<T>(l: T, r: T, msg?: string): void;
}
export = assert;

View File

@@ -0,0 +1,10 @@
import assert = require("minimalistic-assert");
assert(true);
assert(false, "error");
assert("yes");
assert(0, "error");
assert.equal(1, 1);
assert.equal(2, 1, "error");
assert.equal("ok", "ok");

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",
"minimalistic-assert-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }