{"_id":"@pnpm/catalogs.resolver@1100.1.2","bugs":{"url":"https://github.com/pnpm/pnpm/issues"},"dist":{"shasum":"641d666db2c63d206a76ac6491489fe9b39deabd","tarball":"http://registry-npm.ywwl.com/@pnpm/catalogs.resolver/download/@pnpm/catalogs.resolver-1100.1.2.tgz","fileCount":10,"integrity":"sha512-qKUZMTbARCqLUJl/LDA7s5zy/Aac1UjgSucDplF1WVGT2rT44SVICL5uFnmmRMtSlcdD3MYH0L9qqamkkx0YDQ==","signatures":[{"sig":"MEYCIQDi0EnA3k3HVzMEeGiObfz/DDvMKXq6sQiID1wT/x2teQIhAMlmysMcgAiQrvBSUvSO8AkIgmw+eADafoNp+XLYKbwQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDY+siKvX1ef9suDOgv6WOq0zbFKkl+yJfO1tSwuBPoSAIgFtA0Tm6GtxwtjAJqGeg0Pi2h6z7UD0ZBGHzq7srvW8w="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pnpm%2fcatalogs.resolver@1100.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9734,"size":3651,"noattachment":false,"key":"/@pnpm/catalogs.resolver/-/@pnpm/catalogs.resolver-1100.1.2.tgz"},"jest":{"preset":"@pnpm/jest-config"},"main":"lib/index.js","name":"@pnpm/catalogs.resolver","type":"module","types":"lib/index.d.ts","engines":{"node":">=22.13"},"exports":{".":"./lib/index.js"},"funding":"https://opencollective.com/pnpm","license":"MIT","scripts":{"lint":"eslint \"src/**/*.ts\" \"test/**/*.ts\"","test":"pn compile && pn .test",".test":"cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest","compile":"tsgo --build && pn lint --fix"},"version":"1100.1.2","_npmUser":{"name":"pnpmuser","email":"publish-bot@pnpm.io"},"homepage":"https://github.com/pnpm/pnpm/tree/main/pnpm11/catalogs/resolver#readme","keywords":["pnpm","pnpm11","types"],"repository":{"url":"https://github.com/pnpm/pnpm/tree/main/pnpm11/catalogs/resolver","type":"git"},"description":"Dereferences catalog protocol specifiers into usable specifiers.","directories":{},"maintainers":[{"name":"pnpmuser","email":"publish-bot@pnpm.io"},{"name":"zkochan","email":"z@kochan.io"}],"dependencies":{"@pnpm/error":"^1100.2.2","@pnpm/catalogs.protocol-parser":"^1100.0.1"},"_hasShrinkwrap":false,"devDependencies":{"@jest/globals":"30.4.1","@pnpm/catalogs.types":"1100.0.1","@pnpm/catalogs.resolver":"1100.1.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/catalogs.resolver_1100.1.2_1791245726769_0.7046922797492452"},"readme":"# @pnpm/catalogs.resolver\n\n> Dereferences `catalog:` protocol specifiers into usable specifiers.\n\n## Usage\n\n### `resolveFromCatalog`\n\nDereferences a wanted dependency using the catalog protocol and returns the configured specifier.\n\nReturns one of three resolution result types:\n- `found`: The catalog entry was found and resolved to a usable specifier.\n- `unused`: The dependency specifier does not use the `catalog:` protocol.\n- `misconfiguration`: The catalog entry is missing, uses recursive catalog definitions, or uses unsupported protocols (`link:`, `file:`).\n\n```ts\nimport { resolveFromCatalog } from '@pnpm/catalogs.resolver'\n\nconst result = resolveFromCatalog(catalogs, {\n  alias: 'react',\n  bareSpecifier: 'catalog:',\n})\n\nif (result.type === 'found') {\n  console.log(result.resolution.specifier) // e.g. '^19.0.0'\n}\n```\n\n### `matchCatalogResolveResult`\n\nUtility pattern matcher for handling the three resolution result variants.\n\n```ts\nimport { matchCatalogResolveResult, resolveFromCatalog } from '@pnpm/catalogs.resolver'\n\nconst result = resolveFromCatalog(catalogs, wantedDependency)\n\nmatchCatalogResolveResult(result, {\n  found: ({ resolution }) => console.log('Resolved:', resolution.specifier),\n  unused: () => console.log('Not using catalog protocol'),\n  misconfiguration: ({ error }) => {\n    throw error\n  },\n})\n```\n","publish_time":1791245726848,"_cnpm_publish_time":1791245726848,"dist-tags":{"latest":"1100.1.2"}}