Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No Ticket] Fix tiny hashes import when building with webpack #220

Merged
merged 2 commits into from
Oct 20, 2023
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
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
Loading