(text, sig)
| 357 | // hikari -> "hikaricp", s3 -> "...-s3"). Signatures that intentionally start with a |
| 358 | // separator (e.g. ".jks") are matched as plain substrings. |
| 359 | function signatureMatches(text, sig) { |
| 360 | const s = sig.toLowerCase(); |
| 361 | if (!s) return false; |
| 362 | const alnum = (c) => (c >= "a" && c <= "z") || (c >= "0" && c <= "9"); |
| 363 | if (!alnum(s[0])) return text.includes(s); |
| 364 | let from = 0; |
| 365 | for (;;) { |
| 366 | const i = text.indexOf(s, from); |
| 367 | if (i < 0) return false; |
| 368 | const before = i === 0 ? "" : text[i - 1]; |
| 369 | if (before === "" || !alnum(before)) return true; // signature begins a token |
| 370 | from = i + 1; |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | function detectDependencies(buildText) { |
| 375 | const text = (buildText || "").toLowerCase(); |
no test coverage detected