From 861b87f6baa8527fb7bcd73f241355b6444053a2 Mon Sep 17 00:00:00 2001 From: "Junyoung Choi (Sai)" Date: Wed, 24 Jan 2018 03:28:25 +0900 Subject: [PATCH] Add dashify (#23092) * Add dashify * Use 4 spaces --- types/dashify/dashify-tests.ts | 7 +++++++ types/dashify/index.d.ts | 14 ++++++++++++++ types/dashify/tsconfig.json | 23 +++++++++++++++++++++++ types/dashify/tslint.json | 3 +++ 4 files changed, 47 insertions(+) create mode 100644 types/dashify/dashify-tests.ts create mode 100644 types/dashify/index.d.ts create mode 100644 types/dashify/tsconfig.json create mode 100644 types/dashify/tslint.json diff --git a/types/dashify/dashify-tests.ts b/types/dashify/dashify-tests.ts new file mode 100644 index 0000000000..3ff76d8628 --- /dev/null +++ b/types/dashify/dashify-tests.ts @@ -0,0 +1,7 @@ +import dashify = require('dashify'); + +const output: string = dashify('Foo----Bar'); +// => 'foo----bar' + +const output2: string = dashify('Foo----Bar', {condense: true}); +// => 'foo-bar' diff --git a/types/dashify/index.d.ts b/types/dashify/index.d.ts new file mode 100644 index 0000000000..54894f9e59 --- /dev/null +++ b/types/dashify/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for dashify 1.0 +// Project: https://github.com/jonschlinkert/dashify +// Definitions by: Junyoung Choi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function dashify(input: string, options?: dashify.Options): string; + +declare namespace dashify { + interface Options { + condense?: boolean; + } +} + +export = dashify; diff --git a/types/dashify/tsconfig.json b/types/dashify/tsconfig.json new file mode 100644 index 0000000000..81e84c030c --- /dev/null +++ b/types/dashify/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dashify-tests.ts" + ] +} \ No newline at end of file diff --git a/types/dashify/tslint.json b/types/dashify/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/dashify/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}