From f498c98b3bd3ea10cef853f2ce19a28ad0b23aa4 Mon Sep 17 00:00:00 2001 From: Ethan Rubio Date: Sat, 5 Nov 2016 19:11:01 -0700 Subject: [PATCH] Add string-hash (#12499) Refactor string-hash definition Refactor string-hash to use commonjs --- string-hash/index.d.ts | 8 ++++++++ string-hash/string-hash-tests.ts | 3 +++ string-hash/tsconfig.json | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 string-hash/index.d.ts create mode 100644 string-hash/string-hash-tests.ts create mode 100644 string-hash/tsconfig.json diff --git a/string-hash/index.d.ts b/string-hash/index.d.ts new file mode 100644 index 0000000000..5b8986e05b --- /dev/null +++ b/string-hash/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for string-hash 1.1.1 +// Project: https://github.com/darkskyapp/string-hash +// Definitions by: Ethan Rubio +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function stringHash(str: string): number; + +export = stringHash; diff --git a/string-hash/string-hash-tests.ts b/string-hash/string-hash-tests.ts new file mode 100644 index 0000000000..3723fd87bb --- /dev/null +++ b/string-hash/string-hash-tests.ts @@ -0,0 +1,3 @@ +import hash = require("string-hash"); + +const newHash: number = hash("Mary had a little lamb."); // 1766333550 diff --git a/string-hash/tsconfig.json b/string-hash/tsconfig.json new file mode 100644 index 0000000000..e93748c357 --- /dev/null +++ b/string-hash/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "string-hash-tests.ts" + ] +} \ No newline at end of file