| 95 | } |
| 96 | |
| 97 | function wrapperSpec(wrapperDir: string, name: string) { |
| 98 | if (name.startsWith("@")) { |
| 99 | const [scope, pkg] = name.split("/") |
| 100 | if (!scope || !pkg || basename(dirname(wrapperDir)) !== scope) return undefined |
| 101 | const prefix = `${pkg}@` |
| 102 | const base = basename(wrapperDir) |
| 103 | return base.startsWith(prefix) ? base.slice(prefix.length) : undefined |
| 104 | } |
| 105 | |
| 106 | const prefix = `${name}@` |
| 107 | const base = basename(wrapperDir) |
| 108 | return base.startsWith(prefix) ? base.slice(prefix.length) : undefined |
| 109 | } |
| 110 | |
| 111 | export function isAutoUpdatableSpec(spec: string) { |
| 112 | const value = spec.trim() |