🤖 Merge PR #62937 [is-semver] Add types by @BendingBender

This commit is contained in:
Dimitri B
2022-10-28 08:39:07 +02:00
committed by GitHub
parent fe7d7cf8b5
commit c72f4bbc15
4 changed files with 53 additions and 0 deletions

26
types/is-semver/index.d.ts vendored Normal file
View File

@@ -0,0 +1,26 @@
// Type definitions for is-semver 1.0
// Project: https://github.com/IonicaBizau/is-semver#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = isSemver;
/**
* Check if an input value is a valid semver version or not.
*
* @param input The version string to check.
* @returns `true` if the input is a valid semver version or `false` otherwise.
*
* @example
* import isSemver = require("is-semver");
*
* console.log(isSemver("1.2.3"));
* // => true
*
* console.log(isSemver("a.b.c"));
* // => false
*
* console.log(isSemver("foo"));
* // => false
*/
declare function isSemver(input: string): boolean;

View File

@@ -0,0 +1,3 @@
import isSemver = require('is-semver');
isSemver('1.2.3'); // $ExpectType boolean

View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"is-semver-tests.ts"
]
}

View File

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