Merge pull request #18195 from Rokt33r/filenamify

Add typings for filenamify
This commit is contained in:
Wesley Wigham
2017-07-19 18:29:42 -07:00
committed by GitHub
4 changed files with 50 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
import * as filenamify from 'filenamify';
filenamify('<foo/bar>');
// => 'foo!bar'
filenamify('foo:"bar"', {replacement: '🐴'});
// => 'foo🐴bar'
filenamify.path('/some/!path');
// => '/some/path'
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for filenamify 2.0
// Project: https://github.com/sindresorhus/filenamify
// Definitions by: Junyoung Choi <https://github.com/rokt33r>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function filenamify(input: string, options?: filenamify.Options): string;
declare namespace filenamify {
interface Options {
replacement: string;
}
function path(input: string, options?: filenamify.Options): string;
}
export = filenamify;
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"filenamify-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}