mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
🤖 Merge PR #62937 [is-semver] Add types by @BendingBender
This commit is contained in:
26
types/is-semver/index.d.ts
vendored
Normal file
26
types/is-semver/index.d.ts
vendored
Normal 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;
|
||||
3
types/is-semver/is-semver-tests.ts
Normal file
3
types/is-semver/is-semver-tests.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import isSemver = require('is-semver');
|
||||
|
||||
isSemver('1.2.3'); // $ExpectType boolean
|
||||
23
types/is-semver/tsconfig.json
Normal file
23
types/is-semver/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/is-semver/tslint.json
Normal file
1
types/is-semver/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "@definitelytyped/dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user