mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-06 15:07:27 -04:00
Also, better naming of variables in @pnpm/resolve-dependencies. This is refactoring of supi to make it easier to do the performance improvements for #1366. PR #1399
14 lines
368 B
TypeScript
14 lines
368 B
TypeScript
export function nodeIdContainsSequence (nodeId: string, pkgId1: string, pkgId2: string) {
|
|
return nodeId.indexOf(`>${pkgId1}>${pkgId2}>`) !== -1
|
|
}
|
|
|
|
export function createNodeId (parentNodeId: string, pkgId: string) {
|
|
return `${parentNodeId}${pkgId}>`
|
|
}
|
|
|
|
export function splitNodeId (nodeId: string) {
|
|
return nodeId.split('>')
|
|
}
|
|
|
|
export const ROOT_NODE_ID = '>/>'
|