Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@types/semver
Advanced tools
The @types/semver package provides TypeScript type definitions for the semver package, which is a utility for handling semantic versions. It allows developers to parse, compare, and manipulate semantic versions in TypeScript projects with type safety.
Parsing a version
This feature allows you to parse a semantic version string and access its components, such as the major, minor, and patch versions.
"import semver from 'semver';\nconst version = semver.parse('1.2.3');\nconsole.log(version.major); // 1"
Comparing versions
This feature enables you to compare two semantic version strings and determine their order.
"import semver from 'semver';\nconst result = semver.compare('1.2.3', '1.2.4');\nconsole.log(result); // -1"
Satisfying ranges
This functionality allows you to check if a semantic version satisfies a given version range.
"import semver from 'semver';\nconst satisfied = semver.satisfies('1.2.3', '^1.0.0');\nconsole.log(satisfied); // true"
This package provides functionality for comparing version numbers. While it offers similar version comparison capabilities, it lacks the broader feature set of semver, such as range checking and version parsing.
A simple package for comparing version strings. It is more lightweight than semver but does not support semantic versioning's pre-release and build metadata.
npm install --save @types/semver
This package contains type definitions for semver v4.3.4 (https://github.com/npm/node-semver).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/semver
Additional Details
These definitions were written by Bart van der Schoor https://github.com/Bartvds.
FAQs
TypeScript definitions for semver
The npm package @types/semver receives a total of 19,501,761 weekly downloads. As such, @types/semver popularity was classified as popular.
We found that @types/semver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.