{"versions":{"0.1.0":{"name":"@bpmn-io/semver-compat","version":"0.1.0","description":"Check whether provided semver versions satisfy required ranges","type":"module","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/bpmn-io/semver-compat.git"},"author":{"name":"bpmn.io contributors"},"license":"MIT","bugs":{"url":"https://github.com/bpmn-io/semver-compat/issues"},"homepage":"https://github.com/bpmn-io/semver-compat#readme","scripts":{"all":"run-s lint build check-types test","build":"rollup -c && tsc","test":"mocha --recursive test","lint":"eslint .","prepare":"run-s build","check-types":"tsc --noEmit"},"dependencies":{"semver":"^7.7.2"},"devDependencies":{"@rollup/plugin-commonjs":"^29.0.2","@rollup/plugin-node-resolve":"^16.0.0","@types/chai":"^5.0.0","@types/mocha":"^10.0.0","@types/semver":"^7.0.0","chai":"^6.2.2","eslint":"^9.0.0","eslint-plugin-bpmn-io":"^2.0.0","mocha":"^11.0.0","npm-run-all2":"^8.0.0","rollup":"^4.0.0","typescript":"^5.0.0"},"gitHead":"35f0ee992818e1170c551df87cb57c074e77d807","_id":"@bpmn-io/semver-compat@0.1.0","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-hIcW42Ku92MUioL6aknDbRoW1jK8ZEqIe8qZZ+d3cjitDO+PMEFFXj/sezJYIHMe8elu4CBz9qpjkV8WIVG9qw==","shasum":"7db7437a4f2b65403b3279502e5fa86be2ebbe5f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@bpmn-io/semver-compat/-/semver-compat-0.1.0.tgz","fileCount":5,"unpackedSize":222403,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFr4BngwvJPDOiodT9HtioTKzyvag/gDilt00OSDgFMoAiBNHNHKyWTSqspKL3FGctkVcH+hrD8oOR53FChqnUNW+w=="}],"size":46649},"_npmUser":{"name":"anonymous","email":"bpmnio@camunda.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"bpmnio@camunda.com"},{"name":"anonymous","email":"git_nikku@nixis.de"},{"name":"anonymous","email":"maciejbarel@gmail.com"},{"name":"anonymous","email":"philippfromme@outlook.com"},{"name":"anonymous","email":"maximilian.trumpf@camunda.com"},{"name":"anonymous","email":"valentin.serra@camunda.com"},{"name":"anonymous","email":"vinicius@vsgoulart.com"},{"name":"anonymous","email":"ali.barin53@gmail.com"},{"name":"anonymous","email":"jarek.danielak@camunda.com"},{"name":"anonymous","email":"ev.bilske@camunda.com"},{"name":"anonymous","email":"alekseyManetov@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/semver-compat_0.1.0_1778229144763_0.9665591321164233"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-05-08T08:32:24.924Z","publish_time":1778229144924,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.1.0"},"name":"@bpmn-io/semver-compat","time":{"created":"2026-06-09T11:05:55.212Z","modified":"2026-07-08T15:54:25.808Z","0.1.0":"2026-05-08T08:32:24.924Z"},"readme":"# @bpmn-io/semver-compat\n\n[![CI](https://github.com/jarekdanielak/semver-compat/actions/workflows/CI.yml/badge.svg)](https://github.com/jarekdanielak/semver-compat/actions/workflows/CI.yml)\n\nCheck whether provided semver versions satisfy required ranges.\n\n## Installation\n\n```sh\nnpm install @bpmn-io/semver-compat\n```\n\n## Usage\n\n### `isCompatible(required, provided)`\n\nReturns `true` if every entry in `required` is satisfied by the corresponding version in `provided`.\n\n```js\nimport { isCompatible } from '@bpmn-io/semver-compat';\n\nisCompatible(\n  { node: '>=18', npm: '>=9' },  // required\n  { node: '16',   npm: '10'  }   // provided\n); // → false\n\nisCompatible(\n  { node: '>=18', npm: '>=9' },\n  { node: '20',   npm: '10'  }\n); // → true\n```\n\n### Behavior\n\nThe compatibility check **fails open**: when data is missing or unparseable the entry is considered compatible, so misconfiguration never blocks the user unexpectedly.\n\nOnly keys present in both `required` and `provided` are checked:\n\n```js\nisCompatible(\n  { node: '>=18', npm: '>=9' },\n  { node: '20' }               // npm not provided\n); // → true\n```\n\nEntries in `provided` whose value cannot be coerced to semver are skipped (treated as compatible):\n\n```js\nisCompatible(\n  { node: '>=18' },\n  { node: 'not-a-version' }\n); // → true\n```\n\nEntries in `required` with an invalid semver range are skipped (treated as compatible):\n\n```js\nisCompatible(\n  { node: 'not-a-range' },\n  { node: '20' }\n); // → true\n```\n\n| Parameter  | Type            | Description                       |\n|------------|-----------------|-----------------------------------|\n| `required` | `SemverRanges`  | Named semver range requirements   |\n| `provided` | `SemverVersions`| Named version strings to check    |\n\n### `getCompatible(required, provided)`\n\nReturns the subset of `provided` whose versions satisfy the corresponding ranges in `required`.\n\n```js\ngetCompatible(\n  { node: '>=18', npm: '>=9' },  // required\n  { node: '20',   npm: '8'   }   // provided\n); // → { node: '20' }\n```\n\n| Parameter  | Type            | Description                       |\n|------------|-----------------|-----------------------------------|\n| `required` | `SemverRanges`  | Named semver range requirements   |\n| `provided` | `SemverVersions`| Named version strings to check    |\n\n### `getCoerced(versions)`\n\nReturns the subset of `versions` whose values can be coerced to valid semver, normalized to standard semver format. Entries with uncoercible values are omitted.\n\n```js\ngetCoerced(\n  { node: '20', myLib: '18.0.0.Final', broken: 'not-a-version' }\n); // → { node: '20.0.0', myLib: '18.0.0' }\n```\n\n| Parameter  | Type            | Description                       |\n|------------|-----------------|-----------------------------------|\n| `versions` | `SemverVersions`| Named version strings to coerce   |\n\n### `isSatisfied(range, version)`\n\nReturns `true` if the version satisfies the range, `false` if it does not, or `null` if the check should be skipped — when the range is invalid or the version cannot be coerced to semver.\n\n```js\nisSatisfied('>=18', '20');          // → true\nisSatisfied('>=18', '16');          // → false\nisSatisfied('not-a-range', '20');   // → null\nisSatisfied('>=18', 'not-a-version'); // → null\n```\n\n| Parameter | Type     | Description              |\n|-----------|----------|--------------------------|\n| `range`   | `string` | A semver range string    |\n| `version` | `string` | A version string to check |\n\n## License\n\nMIT","users":{}}