Socket
Socket
Sign inDemoInstall

gh-release-fetch

Package Overview
Dependencies
Maintainers
21
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-release-fetch - npm Package Compare versions

Comparing version 4.0.1 to 4.0.2

10

dist/index.d.ts

@@ -0,3 +1,9 @@

/// <reference types="node" resolution-mode="require"/>
import { Agent } from 'https';
import { RequestInit } from 'node-fetch';
type DownloadOptions = Pick<RequestInit, 'agent'>;
interface DownloadOptions {
agent?: Agent;
}
interface FetchOptions extends Omit<RequestInit, 'agent'>, DownloadOptions {
}
export interface Release {

@@ -10,3 +16,3 @@ repository: string;

}
export declare function fetchLatest(release: Release, fetchOptions?: RequestInit): Promise<void>;
export declare function fetchLatest(release: Release, fetchOptions?: FetchOptions): Promise<void>;
export declare function fetchVersion(release: Release, { agent }?: DownloadOptions): Promise<void>;

@@ -13,0 +19,0 @@ export declare function updateAvailable(repository: string, currentVersion: string, fetchOptions?: RequestInit): Promise<boolean>;

9

dist/index.js

@@ -6,2 +6,3 @@ import { promises as fs } from 'fs';

import { gt } from 'semver';
const versionPrefixRegex = /^v/;
export async function fetchLatest(release, fetchOptions) {

@@ -34,3 +35,5 @@ // eslint-disable-next-line no-param-reassign

extract: release.extract,
agent: { https: agent },
got: {
agent: { https: agent },
},
});

@@ -59,5 +62,5 @@ }

}
const normalizedLatestVersion = latestVersion.replace(/^v/, '');
const normalizedCurrentVersion = currentVersion.replace(/^v/, '');
const normalizedLatestVersion = latestVersion.replace(versionPrefixRegex, '');
const normalizedCurrentVersion = currentVersion.replace(versionPrefixRegex, '');
return gt(normalizedLatestVersion, normalizedCurrentVersion);
}
{
"name": "gh-release-fetch",
"version": "4.0.1",
"version": "4.0.2",
"description": "A library to fetch release binaries from GitHub Releases",

@@ -43,5 +43,5 @@ "main": "dist/index.js",

"@types/download": "8.0.2",
"@types/node": "14.18.48",
"@types/node": "14.18.51",
"@types/semver": "7.5.0",
"@vitest/coverage-c8": "0.31.4",
"@vitest/coverage-v8": "0.32.0",
"husky": "8.0.3",

@@ -51,6 +51,6 @@ "npm-run-all": "4.1.5",

"typescript": "5.1.3",
"vitest": "0.31.4"
"vitest": "0.32.0"
},
"dependencies": {
"@xhmikosr/downloader": "^11.0.2",
"@xhmikosr/downloader": "^12.0.0",
"node-fetch": "^3.3.1",

@@ -57,0 +57,0 @@ "semver": "^7.5.1"

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