Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@renovatebot/pep440

Package Overview
Dependencies
Maintainers
2
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@renovatebot/pep440 - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

index.d.ts

12

index.js

@@ -6,6 +6,8 @@ const { valid, clean, explain } = require("./lib/version");

const {
filter,
maxSatisfying,
minSatisfying,
RANGE_PATTERN,
satisfies,
validRange,
maxSatisfying,
minSatisfying
} = require("./lib/specifier");

@@ -35,5 +37,7 @@

// range
satisfies,
filter,
maxSatisfying,
minSatisfying,
RANGE_PATTERN,
satisfies,
validRange,

@@ -45,3 +49,3 @@

patch,
inc
inc,
};

@@ -18,3 +18,3 @@ const { parse } = require("./version");

">": gt,
"===": arbitrary
"===": arbitrary,
};

@@ -66,3 +66,5 @@

// see https://stackoverflow.com/a/5292332/1438522
function pyCompare(elem, other) {
function pyCompare(elemIn, otherIn) {
let elem = elemIn;
let other = otherIn;
if (elem === other) {

@@ -94,3 +96,5 @@ return 0;

function calculateKey({ epoch, release, pre, post, dev, local }) {
function calculateKey(input) {
const { epoch } = input;
let { release, pre, post, local, dev } = input;
// When we compare a release version, we want to compare it with all of the

@@ -134,4 +138,4 @@ // trailing zeros removed. So we'll use a reverse the list, drop all the now

// match exactly
local = local.map(
i => (Number.isNaN(Number(i)) ? [-Infinity, i] : [Number(i), ""])
local = local.map((i) =>
Number.isNaN(Number(i)) ? [-Infinity, i] : [Number(i), ""]
);

@@ -138,0 +142,0 @@ }

@@ -8,3 +8,3 @@ const { explain, parse, stringify } = require("./version");

patch,
inc
inc,
};

@@ -84,7 +84,4 @@

{
const [
majorVersion,
minorVersion = 0,
patchVersion = 0
] = version.release;
const [majorVersion, minorVersion = 0, patchVersion = 0] =
version.release;
version.release.fill(0);

@@ -102,7 +99,4 @@ version.release[0] = majorVersion;

if (version.pre === null) {
const [
majorVersion,
minorVersion = 0,
patchVersion = 0
] = version.release;
const [majorVersion, minorVersion = 0, patchVersion = 0] =
version.release;
version.release.fill(0);

@@ -132,3 +126,3 @@ version.release[0] = majorVersion;

if (
version.release.slice(1).some(value => value !== 0) ||
version.release.slice(1).some((value) => value !== 0) ||
version.pre === null

@@ -147,3 +141,3 @@ ) {

if (
version.release.slice(2).some(value => value !== 0) ||
version.release.slice(2).some((value) => value !== 0) ||
version.pre === null

@@ -163,10 +157,7 @@ ) {

if (
version.release.slice(3).some(value => value !== 0) ||
version.release.slice(3).some((value) => value !== 0) ||
version.pre === null
) {
const [
majorVersion,
minorVersion = 0,
patchVersion = 0
] = version.release;
const [majorVersion, minorVersion = 0, patchVersion = 0] =
version.release;
version.release.fill(0);

@@ -173,0 +164,0 @@ version.release[0] = majorVersion;

@@ -18,3 +18,3 @@ // This file is dual licensed under the terms of the Apache License, Version

/* */ "(?<legacy>[^,;\\s)]+)",
")"
")",
].join("");

@@ -29,6 +29,6 @@

maxSatisfying,
minSatisfying
minSatisfying,
};
const isEqualityOperator = op => ["==", "!=", "==="].includes(op);
const isEqualityOperator = (op) => ["==", "!=", "==="].includes(op);

@@ -44,4 +44,4 @@ const rangeRegex = new XRegExp("^" + RANGE_PATTERN + "$", "i");

.split(",")
.map(range => XRegExp.exec(range.trim(), rangeRegex))
.map(groups => {
.map((range) => XRegExp.exec(range.trim(), rangeRegex))
.map((groups) => {
if (!groups) {

@@ -85,4 +85,3 @@ return null;

function filter(versions, specifier, options) {
options = options || {};
function filter(versions, specifier, options = {}) {
const filtered = pick(versions, specifier, options);

@@ -112,3 +111,3 @@ if (filtered.length === 0 && options.prereleases === undefined) {

return versions.filter(version => {
return versions.filter((version) => {
const explained = explainVersion(version);

@@ -129,4 +128,3 @@

function satisfies(version, specifier, options) {
options = options || {};
function satisfies(version, specifier, options = {}) {
const filtered = pick([version], specifier, options);

@@ -137,3 +135,5 @@

function contains(specifier, { version, explained }) {
function contains(specifier, input) {
const { explained } = input;
let { version } = input;
const { ...spec } = specifier;

@@ -150,6 +150,3 @@

if (spec.operator === "~=") {
let compatiblePrefix = spec.release
.slice(0, -1)
.concat("*")
.join(".");
let compatiblePrefix = spec.release.slice(0, -1).concat("*").join(".");
if (spec.epoch) {

@@ -156,0 +153,0 @@ compatiblePrefix = spec.epoch + "!" + compatiblePrefix;

@@ -31,3 +31,3 @@ const XRegExp = require("xregexp");

")",
"(?:\\+(?<local>[a-z0-9]+(?:[-_\\.][a-z0-9]+)*))?" // local version
"(?:\\+(?<local>[a-z0-9]+(?:[-_\\.][a-z0-9]+)*))?", // local version
].join("");

@@ -41,3 +41,3 @@

parse,
stringify
stringify,
};

@@ -73,3 +73,3 @@

dev: normalize_letter_version(groups.dev_l, groups.dev_n),
local: parse_local_version(groups.local)
local: parse_local_version(groups.local),
};

@@ -113,3 +113,5 @@

function normalize_letter_version(letter, number) {
function normalize_letter_version(letterIn, numberIn) {
let letter = letterIn;
let number = numberIn;
if (letter) {

@@ -155,4 +157,4 @@ // We consider there to be an implicit 0 in a pre-release if there is

.split(/[._-]/)
.map(
part => (Number.isNaN(Number(part)) ? part.toLowerCase() : Number(part))
.map((part) =>
Number.isNaN(Number(part)) ? part.toLowerCase() : Number(part)
);

@@ -193,4 +195,4 @@ }

is_devrelease,
is_postrelease
is_postrelease,
};
}
{
"name": "@renovatebot/pep440",
"version": "1.0.0",
"version": "1.1.0",
"description": "PEP440 implementation in JavaScript",
"main": "index.js",
"scripts": {
"prettier": "prettier \"**/*.{js,json,md}\" --write",
"codecov": "codecov",
"lint": "eslint lib test index.js",
"eslint": "eslint lib test index.js",
"eslint-fix": "eslint lib test index.js --fix",
"jest": "jest --env=node",
"test": "npm run prettier --list-different && npm run lint && npm run jest"
"prettier": "prettier --check \"**/*.{ts,js,mjs,json,md}\"",
"prettier-fix": "prettier --write \"**/*.{ts,js,mjs,json,md}\"",
"test": "run-s prettier eslint jest"
},

@@ -27,11 +29,14 @@ "repository": {

"devDependencies": {
"codecov": "3.8.1",
"eslint": "7.17.0",
"eslint-config-airbnb-base": "14.2.1",
"eslint-config-prettier": "7.1.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-promise": "4.2.1",
"jest": "26.6.3",
"prettier": "2.2.1"
"codecov": "3.8.2",
"conventional-changelog-conventionalcommits": "4.6.3",
"eslint": "8.6.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-promise": "6.0.0",
"jest": "27.4.5",
"npm-run-all": "4.1.5",
"prettier": "2.5.1",
"semantic-release": "18.0.1"
},

@@ -46,3 +51,3 @@ "jest": {

"json",
"lcov",
"html",
"text-summary"

@@ -53,3 +58,4 @@ ]

"index.js",
"lib"
"lib",
"index.d.ts"
],

@@ -56,0 +62,0 @@ "dependencies": {

@@ -0,1 +1,7 @@

![build](https://github.com/renovatebot/pep440/workflows/build/badge.svg)
# pep440
Python PEP440 implementation in JavaScript.
This logic has been ported from Python for the purposes of use in [Renovate Bot](https://github.com/renovatebot/renovate).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc