Skip to content

Commit

Permalink
[No Ticket] Fix tiny hashes import when building with webpack (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschuwalow authored Oct 20, 2023
1 parent 26157ca commit 7d48788
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
13 changes: 4 additions & 9 deletions src/typings/tiny-hashes.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
declare module 'tiny-hashes/md5' {
export default function md5(str: string): string
}

declare module 'tiny-hashes/sha1' {
export default function sha1(str: string): string
}
declare module 'tiny-hashes/dist' {
export function md5(str: string): string
export function sha1(str: string): string
export function sha256(str: string): string

declare module 'tiny-hashes/sha256' {
export default function sha256(str: string): string
}
6 changes: 3 additions & 3 deletions src/typings/window.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ILiveConnect } from '../types'
import { InternalLiveConnect } from '../types'

declare global {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type XDomainRequest = any

interface Window {
// eslint-disable-next-line camelcase
liQ_instances?: ILiveConnect[]
liQ?: ILiveConnect | unknown[]
liQ_instances?: InternalLiveConnect[]
liQ?: InternalLiveConnect | unknown[]
XDomainRequest?: { new(): XDomainRequest; prototype: XDomainRequest; create(): XDomainRequest }; // for IE compat
[k: string]: unknown // allow accessing arbitrary fields
msCrypto: Crypto
Expand Down
4 changes: 1 addition & 3 deletions src/utils/hash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import md5 from 'tiny-hashes/md5'
import sha1 from 'tiny-hashes/sha1'
import sha256 from 'tiny-hashes/sha256'
import { md5, sha1, sha256 } from 'tiny-hashes/dist'
import { HashedEmail } from '../types'
import { trim } from 'live-connect-common'

Expand Down

0 comments on commit 7d48788

Please sign in to comment.