Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/stale-dogs-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@emotion/hash': patch
---

Source code has been migrated to TypeScript. From now on type declarations will be emitted based on that, instead of being hand-written.
5 changes: 2 additions & 3 deletions packages/hash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
"description": "A MurmurHash2 implementation",
"main": "dist/emotion-hash.cjs.js",
"module": "dist/emotion-hash.esm.js",
"types": "types/index.d.ts",
"types": "dist/emotion-hash.cjs.d.ts",
"license": "MIT",
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/hash",
"publishConfig": {
"access": "public"
},
"files": [
"src",
"dist",
"types/*.d.ts"
"dist"
],
"scripts": {
"test:typescript": "dtslint types"
Expand Down
2 changes: 1 addition & 1 deletion packages/hash/src/index.js → packages/hash/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86

export default function murmur2(str /*: string */) {
export default function murmur2(str: string): string {
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.

Expand Down
2 changes: 1 addition & 1 deletion packages/hash/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default function murmurhash2_32_gc(str: string): string
export { default } from '../src'