{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export default function (\n pkgName: string,\n pkgVersion: string,\n opts?: {\n registry?: string\n }): string {\n let registry!: string\n if (opts?.registry) {\n registry = opts.registry.endsWith('/') ? opts.registry : `${opts.registry}/`\n } else {\n registry = 'https://registry.npmjs.org/'\n }\n\n const scopelessName = getScopelessName(pkgName)\n return `${registry}${pkgName}/-/${scopelessName}-${removeBuildMetadataFromVersion(pkgVersion)}.tgz`\n}\n\nfunction removeBuildMetadataFromVersion (version: string) {\n const plusPos = version.indexOf('+')\n if (plusPos === -1) return version\n return version.substring(0, plusPos)\n}\n\nfunction getScopelessName (name: string) {\n if (name[0] !== '@') {\n return name\n }\n return name.split('/')[1]\n}\n"],"mappings":";AAAe,SAAR,YACL,SACA,YACA,MAEW;AACX,MAAI;AACJ,MAAI,6BAAM,UAAU;AAClB,eAAW,KAAK,SAAS,SAAS,GAAG,IAAI,KAAK,WAAW,GAAG,KAAK,QAAQ;AAAA,EAC3E,OAAO;AACL,eAAW;AAAA,EACb;AAEA,QAAM,gBAAgB,iBAAiB,OAAO;AAC9C,SAAO,GAAG,QAAQ,GAAG,OAAO,MAAM,aAAa,IAAI,+BAA+B,UAAU,CAAC;AAC/F;AAEA,SAAS,+BAAgC,SAAiB;AACxD,QAAM,UAAU,QAAQ,QAAQ,GAAG;AACnC,MAAI,YAAY;AAAI,WAAO;AAC3B,SAAO,QAAQ,UAAU,GAAG,OAAO;AACrC;AAEA,SAAS,iBAAkB,MAAc;AACvC,MAAI,KAAK,CAAC,MAAM,KAAK;AACnB,WAAO;AAAA,EACT;AACA,SAAO,KAAK,MAAM,GAAG,EAAE,CAAC;AAC1B;","names":[]}