{"name":"@pnpm/catalogs.resolver","version":"1100.1.1","keywords":["pnpm","pnpm11","types"],"license":"MIT","_id":"@pnpm/catalogs.resolver@1100.1.1","maintainers":[{"name":"pnpmuser","email":"publish-bot@pnpm.io"},{"name":"zkochan","email":"z@kochan.io"}],"homepage":"https://github.com/pnpm/pnpm/tree/main/pnpm11/catalogs/resolver#readme","bugs":{"url":"https://github.com/pnpm/pnpm/issues"},"dist":{"shasum":"3f4f8d7fe2d7e4dce522fb717de0d8d2debe6115","tarball":"http://registry-npm.ywwl.com/@pnpm/catalogs.resolver/download/@pnpm/catalogs.resolver-1100.1.1.tgz","fileCount":10,"integrity":"sha512-pKHzetBn98KgiGrkJm2kKRtD3eI62snWMQ/T0tAfKw3HwWnaTfoqnALmPIl72FNFVSYvw0+X0HZBIaKYos0e/Q==","signatures":[{"sig":"MEQCIEdfDKcfqLuNIACTemyvBP8cHsuKIpIdnpYMZ+F6H/H2AiBjDSb7pzUjNwWrOGWDs+NmGZfGnZRTIQrje5/A5pPDlw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQD54jyy6KLdyBEq7zYsAUVkB33uQuVhGiEQGeqstjmH3wIhAJw142BY0y/W56QzroYfK+fEyDf5UZHxRF9Z2U++EAgR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@pnpm%2fcatalogs.resolver@1100.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9429,"size":3559,"noattachment":false,"key":"/@pnpm/catalogs.resolver/-/@pnpm/catalogs.resolver-1100.1.1.tgz"},"jest":{"preset":"@pnpm/jest-config"},"main":"lib/index.js","type":"module","types":"lib/index.d.ts","engines":{"node":">=22.13"},"exports":{".":"./lib/index.js"},"funding":"https://opencollective.com/pnpm","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"},"_npmUser":{"name":"pnpmuser","email":"publish-bot@pnpm.io"},"repository":{"url":"https://github.com/pnpm/pnpm/tree/main/pnpm11/catalogs/resolver","type":"git"},"description":"Dereferences catalog protocol specifiers into usable specifiers.","directories":{},"dependencies":{"@pnpm/error":"^1100.2.1","@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.1"},"_npmOperationalInternal":{"tmp":"tmp/catalogs.resolver_1100.1.1_1790579691234_0.9668391924273063","host":"s3://npm-registry-packages-npm-production"},"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":1790579691315,"_cnpm_publish_time":1790579691315,"dist-tags":{"latest":"1100.1.2"}}