Skip to content

Commit ac96549

Browse files
🤖 Merge PR DefinitelyTyped#72263 [is-fqdn] Add types for is-fqdn by @MysteryBlokHed
1 parent 3a0c56f commit ac96549

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

types/is-fqdn/.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*
2+
!**/*.d.ts
3+
!**/*.d.cts
4+
!**/*.d.mts
5+
!**/*.d.*.ts

types/is-fqdn/index.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
declare namespace isFQDN {
2+
interface Options {
3+
/**
4+
* @default true
5+
*/
6+
requireTld?: boolean | undefined;
7+
/**
8+
* @default false
9+
*/
10+
allowUnderscores?: boolean | undefined;
11+
/**
12+
* @default false
13+
*/
14+
allowTrailingDot?: boolean | undefined;
15+
}
16+
}
17+
18+
declare function isFQDN(str: string, options?: isFQDN.Options): boolean;
19+
20+
export = isFQDN;

types/is-fqdn/is-fqdn-tests.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import isFQDN = require("is-fqdn");
2+
3+
// @ts-expect-error No arguments
4+
isFQDN();
5+
6+
// $ExpectType boolean
7+
isFQDN("foo");
8+
// $ExpectType boolean
9+
isFQDN("foo", {});
10+
// $ExpectType boolean
11+
isFQDN("foo", {
12+
requireTld: true,
13+
allowUnderscores: true,
14+
allowTrailingDot: true,
15+
});

types/is-fqdn/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"private": true,
3+
"name": "@types/is-fqdn",
4+
"version": "2.0.9999",
5+
"projects": [
6+
"https://github.com/parro-it/is-fqdn#readme"
7+
],
8+
"devDependencies": {
9+
"@types/is-fqdn": "workspace:."
10+
},
11+
"owners": [
12+
{
13+
"name": "Adam Thompson-Sharpe",
14+
"githubUsername": "MysteryBlokHed"
15+
}
16+
]
17+
}

types/is-fqdn/tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"module": "node16",
4+
"lib": ["es6"],
5+
"noImplicitAny": true,
6+
"noImplicitThis": true,
7+
"strictFunctionTypes": true,
8+
"strictNullChecks": true,
9+
"types": [],
10+
"noEmit": true,
11+
"forceConsistentCasingInFileNames": true
12+
},
13+
"files": [
14+
"index.d.ts",
15+
"is-fqdn-tests.ts"
16+
]
17+
}

0 commit comments

Comments
 (0)