mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Add types for sane-email-validation (#27739)
This commit is contained in:
committed by
Sheetal Nandi
parent
b6f7118f87
commit
cdcc5dd4ff
12
types/sane-email-validation/index.d.ts
vendored
Normal file
12
types/sane-email-validation/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for sane-email-validation 1.1
|
||||
// Project: https://github.com/scottgonzalez/sane-email-validation
|
||||
// Definitions by: Forbes Lindesay <https://github.com/ForbesLindesay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function isEmail(email: string): boolean;
|
||||
|
||||
declare namespace isEmail {
|
||||
function isNotEmail(email: string): boolean;
|
||||
}
|
||||
|
||||
export = isEmail;
|
||||
@@ -0,0 +1,9 @@
|
||||
import isEmail = require('sane-email-validation');
|
||||
|
||||
const is: boolean = isEmail('foo@bar.com');
|
||||
const isNot: boolean = isEmail.isNotEmail('foo@bar.com');
|
||||
|
||||
// $ExpectError
|
||||
isEmail(10);
|
||||
// $ExpectError
|
||||
isEmail.isNotEmail(10);
|
||||
23
types/sane-email-validation/tsconfig.json
Normal file
23
types/sane-email-validation/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"sane-email-validation-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/sane-email-validation/tslint.json
Normal file
1
types/sane-email-validation/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user