Function
getHashDigest
(
content: string,
hashType = 'md5',
digestType: BinaryToTextEncoding = 'hex',
length = 9999
)
Source from the content-addressed store, hash-verified
| 22 | export type NameFn = (resourcePath?: string, resourceQuery?: string) => string |
| 23 | |
| 24 | function getHashDigest( |
| 25 | content: string, |
| 26 | hashType = 'md5', |
| 27 | digestType: BinaryToTextEncoding = 'hex', |
| 28 | length = 9999 |
| 29 | ) { |
| 30 | const hasher = createHash(hashType) |
| 31 | hasher.update(content) |
| 32 | return hasher.digest(digestType).slice(0, length) |
| 33 | } |
| 34 | |
| 35 | export function interpolateName( |
| 36 | loaderContext: LoaderContext, |
Tested by
no test coverage detected