Add string-hash (#12499)

Refactor string-hash definition

Refactor string-hash to use commonjs
This commit is contained in:
Ethan Rubio 2016-11-05 19:11:01 -07:00 committed by Andy
parent d2150a603f
commit f498c98b3b
3 changed files with 30 additions and 0 deletions

8
string-hash/index.d.ts vendored Normal file
View File

@ -0,0 +1,8 @@
// Type definitions for string-hash 1.1.1
// Project: https://github.com/darkskyapp/string-hash
// Definitions by: Ethan Rubio <https://github.com/ethanrubio/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function stringHash(str: string): number;
export = stringHash;

View File

@ -0,0 +1,3 @@
import hash = require("string-hash");
const newHash: number = hash("Mary had a little lamb."); // 1766333550

19
string-hash/tsconfig.json Normal file
View File

@ -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"
]
}