From 5e362d9cc9db9fdd66b9aa1a616581fe118e9898 Mon Sep 17 00:00:00 2001 From: Sascha Englert Date: Thu, 20 Sep 2018 17:12:26 +0200 Subject: [PATCH 1/2] Created obj-str definition --- types/obj-str/index.d.ts | 8 ++++++++ types/obj-str/obj-str-tests.ts | 6 ++++++ types/obj-str/tsconfig.json | 22 ++++++++++++++++++++++ types/obj-str/tslint.json | 1 + 4 files changed, 37 insertions(+) create mode 100644 types/obj-str/index.d.ts create mode 100644 types/obj-str/obj-str-tests.ts create mode 100644 types/obj-str/tsconfig.json create mode 100644 types/obj-str/tslint.json diff --git a/types/obj-str/index.d.ts b/types/obj-str/index.d.ts new file mode 100644 index 0000000000..44672fbd0a --- /dev/null +++ b/types/obj-str/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for obj-str 1.0 +// Project: https://github.com/lukeed/obj-str#readme +// Definitions by: Sascha Englert +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = objstr; + +declare function objstr(obj: { [name: string]: boolean }): string; diff --git a/types/obj-str/obj-str-tests.ts b/types/obj-str/obj-str-tests.ts new file mode 100644 index 0000000000..eea0300de7 --- /dev/null +++ b/types/obj-str/obj-str-tests.ts @@ -0,0 +1,6 @@ +import objstr = require('obj-str'); + +const isTrue = () => true; + +objstr({ foo: true, bar: false, baz: isTrue() }); +//=> 'foo baz' diff --git a/types/obj-str/tsconfig.json b/types/obj-str/tsconfig.json new file mode 100644 index 0000000000..ec7d04011d --- /dev/null +++ b/types/obj-str/tsconfig.json @@ -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", + "obj-str-tests.ts" + ] +} diff --git a/types/obj-str/tslint.json b/types/obj-str/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/obj-str/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 40bb1edfacbae3fc4edc48e6321fb947a1e5c9ee Mon Sep 17 00:00:00 2001 From: Sascha Englert Date: Thu, 20 Sep 2018 17:25:57 +0200 Subject: [PATCH 2/2] Adjusted tsconfig and fixed critical whitespace missing in comment /s --- types/obj-str/obj-str-tests.ts | 2 +- types/obj-str/tsconfig.json | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/types/obj-str/obj-str-tests.ts b/types/obj-str/obj-str-tests.ts index eea0300de7..e945aef673 100644 --- a/types/obj-str/obj-str-tests.ts +++ b/types/obj-str/obj-str-tests.ts @@ -3,4 +3,4 @@ import objstr = require('obj-str'); const isTrue = () => true; objstr({ foo: true, bar: false, baz: isTrue() }); -//=> 'foo baz' +// => 'foo baz' diff --git a/types/obj-str/tsconfig.json b/types/obj-str/tsconfig.json index ec7d04011d..e2498d5707 100644 --- a/types/obj-str/tsconfig.json +++ b/types/obj-str/tsconfig.json @@ -1,22 +1,16 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6" - ], + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], + "strictFunctionTypes": true, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "obj-str-tests.ts" - ] + "files": ["index.d.ts", "obj-str-tests.ts"] }