Skip to content

Commit

Permalink
Add browser-extname 1.0 (DefinitelyTyped#45041)
Browse files Browse the repository at this point in the history
* Add browser-extname

* Fix definition for browser-extname

* Fix test for browser-extname
  • Loading branch information
tdukart committed May 30, 2020
1 parent 45524cd commit 835c1a3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
19 changes: 19 additions & 0 deletions types/browser-extname/browser-extname-tests.ts
@@ -0,0 +1,19 @@
import extname = require('browser-extname');

extname('index.html');
// Returns: '.html'

extname('index.coffee.md');
// Returns: '.md'

extname('index.');
// Returns: '.'

extname('index');
// Returns: ''

extname('.index');
// Returns: ''

extname('.index.md');
// Returns: '.md'
7 changes: 7 additions & 0 deletions types/browser-extname/index.d.ts
@@ -0,0 +1,7 @@
// Type definitions for browser-extname 1.0
// Project: https://github.com/pcr910303/extname
// Definitions by: Todd Dukart <https://github.com/tdukart>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare function browser_extname(path: string): string;
export = browser_extname;
23 changes: 23 additions & 0 deletions types/browser-extname/tsconfig.json
@@ -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",
"browser-extname-tests.ts"
]
}
1 change: 1 addition & 0 deletions types/browser-extname/tslint.json
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

0 comments on commit 835c1a3

Please sign in to comment.