{"_id":"@csaf-rs/vers-rs","_rev":"3-151c92a8c5580eb714c4549e4bf9bd11","name":"@csaf-rs/vers-rs","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@csaf-rs/vers-rs","version":"0.1.0","keywords":["vers"],"license":"Apache-2.0","_id":"@csaf-rs/vers-rs@0.1.0","maintainers":[{"name":"tschmidtb51","email":"secvisogram@bsi.bund.de"},{"name":"oxisto","email":"christian.banse@aisec.fraunhofer.de"}],"homepage":"https://github.com/csaf-rs/vers-rs#readme","bugs":{"url":"https://github.com/csaf-rs/vers-rs/issues"},"dist":{"shasum":"26998f9038401935de481e0338e0d3aa973a0c10","tarball":"https://registry.npmjs.org/@csaf-rs/vers-rs/-/vers-rs-0.1.0.tgz","fileCount":6,"integrity":"sha512-ak4Vf9MjsUPcIT8keUh+fxa4RlEqAkwRXb2/CLV64qsyTiPi9bajdUWIkFPYa2tGksvbjt8EV8WwzLGne7o5KQ==","signatures":[{"sig":"MEQCIGjz7vtuP3dazQJ38SlzBOCEOmyviPT7BmBfB5N/iddkAiAYmuNjN8ni9f2i+PNsvCrfOBDlj91pakt0YtqHuQdx8w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":119839},"main":"vers_rs.js","type":"module","types":"vers_rs.d.ts","gitHead":"eb0e9fd41c8a855ce613aebce8fd6897d1111fe7","_npmUser":{"name":"oxisto","email":"christian.banse@aisec.fraunhofer.de"},"repository":{"url":"git+https://github.com/csaf-rs/vers-rs.git","type":"git"},"_npmVersion":"11.4.2","description":"A library for parsing and checking version range specifiers","directories":{},"sideEffects":["./snippets/*"],"_nodeVersion":"24.4.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vers-rs_0.1.0_1764068732503_0.26600182181625787","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@csaf-rs/vers-rs","version":"0.1.1","keywords":["vers"],"license":"Apache-2.0","_id":"@csaf-rs/vers-rs@0.1.1","maintainers":[{"name":"tschmidtb51","email":"secvisogram@bsi.bund.de"},{"name":"oxisto","email":"christian.banse@aisec.fraunhofer.de"}],"homepage":"https://github.com/csaf-rs/vers-rs#readme","bugs":{"url":"https://github.com/csaf-rs/vers-rs/issues"},"dist":{"shasum":"0d6ce5c650d7d30350ace0016debf58fa93ec1ed","tarball":"https://registry.npmjs.org/@csaf-rs/vers-rs/-/vers-rs-0.1.1.tgz","fileCount":7,"integrity":"sha512-3miHNB2eWpfx8QPqNIRN8WouNs6ttrmzE2is3QioLQ/2+Hi5HxqrVGgdloM21V2IHITKnVx51l05CLHddnNH5Q==","signatures":[{"sig":"MEUCIQCDfVDGCLlHj4k4MiKHzgk07lMcNk/nrAEJ8Ug4VnzIGAIgEp2y2s+FUsFPpXpj5mLSoXNJ4oa66mHn3KrYA3HrrTY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@csaf-rs%2fvers-rs@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":115307},"main":"vers_rs.js","type":"module","types":"vers_rs.d.ts","gitHead":"95d5ddc4900a3d292c3f8aa3c4b34322e8c379f4","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:251d4717-fc62-4388-9b6d-c171a6904618"}},"repository":{"url":"git+https://github.com/csaf-rs/vers-rs.git","type":"git"},"_npmVersion":"11.6.2","description":"A library for parsing and checking version range specifiers","directories":{},"sideEffects":["./vers_rs.js","./snippets/*"],"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vers-rs_0.1.1_1764084450218_0.4238592407167834","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@csaf-rs/vers-rs","type":"module","description":"A library for parsing and checking version range specifiers","version":"0.1.2","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/csaf-rs/vers-rs.git"},"main":"vers_rs.js","types":"vers_rs.d.ts","sideEffects":["./vers_rs.js","./snippets/*"],"keywords":["vers"],"gitHead":"c7e806bd9a46877638fc948bd64547ca5ad35f01","_id":"@csaf-rs/vers-rs@0.1.2","bugs":{"url":"https://github.com/csaf-rs/vers-rs/issues"},"homepage":"https://github.com/csaf-rs/vers-rs#readme","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-MVk+d8Oxt4ndPYfP2ZCLirAjPGZo9JKrrJ1awaRSz4Yx5SfxjhYY+lqw8DE4cnVYH4Ev8cQNL1X502s/Lq+1uA==","shasum":"f6f433f3e54c1adaa89e8584b7361e25e19997ca","tarball":"https://registry.npmjs.org/@csaf-rs/vers-rs/-/vers-rs-0.1.2.tgz","fileCount":7,"unpackedSize":123314,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@csaf-rs%2fvers-rs@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHYAsULVFVlG4ZERNOnW2bSnka+v3xWhkXOdXzzVEjIXAiEAlWhvlQw5fKPRYGyT3L6HhV+GMHq+erEhKLRSrKdvA08="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:251d4717-fc62-4388-9b6d-c171a6904618"}},"directories":{},"maintainers":[{"name":"tschmidtb51","email":"secvisogram@bsi.bund.de"},{"name":"oxisto","email":"christian.banse@aisec.fraunhofer.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vers-rs_0.1.2_1764247506755_0.7931718800852456"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-25T11:05:32.390Z","modified":"2025-11-27T12:45:07.337Z","0.1.0":"2025-11-25T11:05:32.699Z","0.1.1":"2025-11-25T15:27:30.420Z","0.1.2":"2025-11-27T12:45:06.950Z"},"bugs":{"url":"https://github.com/csaf-rs/vers-rs/issues"},"license":"Apache-2.0","homepage":"https://github.com/csaf-rs/vers-rs#readme","keywords":["vers"],"repository":{"type":"git","url":"git+https://github.com/csaf-rs/vers-rs.git"},"description":"A library for parsing and checking version range specifiers","maintainers":[{"name":"tschmidtb51","email":"secvisogram@bsi.bund.de"},{"name":"oxisto","email":"christian.banse@aisec.fraunhofer.de"}],"readme":"# vers-rs\n\n[![Build](https://github.com/csaf-rs/vers-rs/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/csaf-rs/vers-rs/actions/workflows/build.yml)\n[![crates.io](https://img.shields.io/crates/v/vers-rs.svg)](https://crates.io/crates/vers-rs)\n[![npm](https://img.shields.io/npm/v/%40csaf-rs%2Fvers-rs.svg)](https://www.npmjs.com/package/@csaf-rs/vers-rs)\n\nA Rust library (with WASM support) for parsing, validating, and checking version\nrange specifiers.\n\nThis library implements the version range specifier (vers) format as described in\nthe [vers-spec](https://github.com/package-url/vers-spec).\n\n## Usage\n\n```rust\nuse vers_rs::schemes::semver::*;\nuse vers_rs::{parse, contains, GenericVersionRange};\nuse vers_rs::range::VersionRange;\n\n// Parse a version range specifier with an explicit type\nlet range: GenericVersionRange<SemVer> = \"vers:npm/>=1.0.0|<2.0.0\".parse().unwrap();\n\n// Parse a version range specifier with dynamic dispatch\nlet dynamic_range = parse(\"vers:npm/>=1.0.0|<2.0.0\").unwrap();\n\n// Check if a version is within the range\nassert!(range.contains(&\"1.5.0\".parse().unwrap()).unwrap());\nassert!(!range.contains(&\"2.0.0\".parse().unwrap()).unwrap());\n\nassert!(dynamic_range.contains(\"1.5.0\").unwrap());\nassert!(!dynamic_range.contains(\"2.0.0\").unwrap());\n```\n\n## Features\n\n- Parse version range specifiers in the format `vers:<versioning-scheme>/<version-constraint>|<version-constraint>|...`\n- Validate version range specifiers according to the rules in the specification\n- Normalize and simplify version range specifiers\n- Check if a version is within a specified range\n- Support for different versioning schemes (npm/semver, pypi, maven, deb, etc.)\n- Dynamic dispatch wrapper that automatically detects version schemes\n\n## TODO: Future Improvements\n\n- **Version Comparison**: Implement proper version comparison for different versioning schemes:\n  - PEP440 for Python/PyPI\n  - Maven versioning rules\n  - Debian versioning rules\n  - RubyGems versioning rules\n\n- **Normalization**: Improve the normalization algorithm:\n  - Use proper version comparison for sorting\n  - Handle more edge cases\n  - Optimize for better performance\n\n- **Validation**: Enhance validation:\n  - Validate version formats for different versioning schemes\n  - Add more detailed error messages\n  - Make sort order validation a hard requirement\n\n- **Error Handling**: Improve error handling:\n  - Add more specific error types\n  - Provide more context in error messages\n  - Consider returning errors for unknown versioning schemes\n","readmeFilename":"README.md"}