New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gasket/utils

Package Overview
Dependencies
Maintainers
8
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gasket/utils - npm Package Compare versions

Comparing version 7.0.0-next.29 to 7.0.0-next.30

lib/get-package-latest-version.js

16

lib/index.d.ts

@@ -56,16 +56,2 @@ import type { GasketConfig, GasketConfigDefinition, MaybeAsync } from '@gasket/core';

/**
* Tries to require a module, but ignores if it is not found. If not found,
* result will be null.
* @example
* const { tryRequire } = require('@gasket/utils');
*
* let someConfig = tryRequire('../might/be/a/path/to/some/file');
*
* if(!someConfig) {
* someConfig = require('./default-config')
* }
*/
export function tryRequire(path: string): object | null;
interface ConfigContext {

@@ -171,1 +157,3 @@ /** Name of environment */

export function warnIfOutdated(pkgName: string, currentVersion: string): MaybeAsync<void>;
export function getPackageLatestVersion(pkgName: string, options?: object): Promise<string>;

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

const tryRequire = require('./try-require');
const { tryResolve } = require('./try-resolve');
const applyConfigOverrides = require('./apply-config-overrides');

@@ -7,10 +5,10 @@ const runShellCommand = require('./run-shell-command');

const warnIfOutdated = require('./warn-if-outdated');
const getPackageLatestVersion = require('./get-package-latest-version');
module.exports = {
tryRequire,
tryResolve,
applyConfigOverrides,
runShellCommand,
PackageManager,
warnIfOutdated
warnIfOutdated,
getPackageLatestVersion
};

@@ -1,2 +0,1 @@

const runShellCommand = require('./run-shell-command');
const semver = require('semver');

@@ -6,2 +5,3 @@ const chalk = require('chalk');

const path = require('path');
const getPackageLatestVersion = require('./get-package-latest-version');

@@ -38,10 +38,7 @@ const cachePath = path.join(__dirname, '..', '.cache'); // Place at root of package

try {
const cmdResult = await runShellCommand('npm', ['view', pkgName, 'version'], {});
if (cmdResult?.stdout) {
const latestVersion = cmdResult.stdout.trim();
cache[LATEST_VERSION_UPDATE_TIME] = currentTime;
cache[LATEST_VERSION] = latestVersion;
await writeFile(cachePath, JSON.stringify(cache));
return latestVersion;
}
const latestVersion = await getPackageLatestVersion(pkgName, {});
cache[LATEST_VERSION_UPDATE_TIME] = currentTime;
cache[LATEST_VERSION] = latestVersion;
await writeFile(cachePath, JSON.stringify(cache));
return latestVersion;
} catch (error) {

@@ -48,0 +45,0 @@ // eslint-disable-next-line no-console

{
"name": "@gasket/utils",
"version": "7.0.0-next.29",
"version": "7.0.0-next.30",
"description": "Reusable utilities for Gasket internals",

@@ -50,3 +50,3 @@ "main": "lib",

"devDependencies": {
"@gasket/core": "^7.0.0-next.29",
"@gasket/core": "^7.0.0-next.30",
"@godaddy/dmd": "^1.0.4",

@@ -81,3 +81,3 @@ "abort-controller": "^3.0.0",

],
"gitHead": "7068aef0e4e8b7aaeb6e4e675d02858779d59ac9"
"gitHead": "0249719e07092027d6e8a077de03ec0bf5eb5124"
}
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