(cur: string, kind: "dep" | "peer")
| 43 | ) |
| 44 | |
| 45 | const setVersion = (cur: string, kind: "dep" | "peer") => { |
| 46 | if (cur === "catalog:" || cur.startsWith("workspace:")) return cur |
| 47 | if (snapshot) return ver |
| 48 | if (kind === "peer") return `>=${ver}` |
| 49 | if (cur.startsWith(">=")) return `>=${ver}` |
| 50 | if (cur.startsWith("^")) return `^${ver}` |
| 51 | if (cur.startsWith("~")) return `~${ver}` |
| 52 | return ver |
| 53 | } |
| 54 | |
| 55 | const editDeps = (obj: unknown, kind: "dep" | "peer") => { |
| 56 | if (!obj || typeof obj !== "object") return false |