(url)
| 563 | * @returns {string} the key |
| 564 | */ |
| 565 | const _getCacheKey = (url) => { |
| 566 | const parsedUrl = new URL(url); |
| 567 | const folder = toSafePath(parsedUrl.origin); |
| 568 | const name = toSafePath(parsedUrl.pathname); |
| 569 | const query = toSafePath(parsedUrl.search); |
| 570 | let ext = extname(name); |
| 571 | if (ext.length > 20) ext = ""; |
| 572 | const basename = ext ? name.slice(0, -ext.length) : name; |
| 573 | const hash = createHash(hashFunction); |
| 574 | hash.update(url); |
| 575 | const digest = hash.digest(hashDigest).slice(0, hashDigestLength); |
| 576 | return `${folder.slice(-50)}/${`${basename}${ |
| 577 | query ? `_${query}` : "" |
| 578 | }`.slice(0, 150)}_${digest}${ext}`; |
| 579 | }; |
| 580 | |
| 581 | const getLockfile = cachedWithoutKey( |
| 582 | /** |
nothing calls this directly
no test coverage detected