mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Add type definitions for semver-compare (#19451)
* Initial type definitions for semver-compare * Fix definitions * Fix tslint errors
This commit is contained in:
committed by
Mohamed Hegazy
parent
f2111f6347
commit
0f62f0016e
8
types/semver-compare/index.d.ts
vendored
Normal file
8
types/semver-compare/index.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Type definitions for semver-compare 1.0
|
||||
// Project: https://github.com/substack/semver-compare
|
||||
// Definitions by: Kovács Vince <https://github.com/vincekovacs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function semverCompare<T>(a: T, b: T): number;
|
||||
|
||||
export = semverCompare;
|
||||
14
types/semver-compare/semver-compare-tests.ts
Normal file
14
types/semver-compare/semver-compare-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import SemverCompare = require("semver-compare");
|
||||
|
||||
const versions = [
|
||||
"1.2.3",
|
||||
"4.11.6",
|
||||
"4.2.0",
|
||||
"1.5.19",
|
||||
"1.5.5",
|
||||
"4.1.3",
|
||||
"2.3.1",
|
||||
"10.5.5",
|
||||
"11.3.0",
|
||||
];
|
||||
versions.sort(SemverCompare).join("\n");
|
||||
22
types/semver-compare/tsconfig.json
Normal file
22
types/semver-compare/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"semver-compare-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/semver-compare/tslint.json
Normal file
1
types/semver-compare/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user