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

@ms-cloudpack/package-utilities

Package Overview
Dependencies
Maintainers
3
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ms-cloudpack/package-utilities - npm Package Compare versions

Comparing version 7.4.8 to 7.4.9

26

lib/PackageDefinitions.js

@@ -6,2 +6,3 @@ import path from 'path';

import { getCloudpackTransform } from './getCloudpackTransform.js';
import { slash } from '@ms-cloudpack/path-string-parsing';
/**

@@ -28,4 +29,6 @@ * `nonSemverTransform` has state defined when the function is called, so we need a wrapper function

async get(packagePath, options = {}) {
let definition = this._definitions[packagePath];
let transformedDefinition = this._transformedDefinitions[packagePath];
// Normalize the path to ensure consistency and avoid duplicates.
const normalizedPath = slash(packagePath);
let definition = this._definitions[normalizedPath];
let transformedDefinition = this._transformedDefinitions[normalizedPath];
const { refresh, disableTransforms, importerContext } = options;

@@ -43,7 +46,7 @@ // If we already have the answer they need, return immediately.

if (!definition || refresh) {
definition = await readJson(path.join(packagePath, 'package.json'));
definition = await readJson(path.join(normalizedPath, 'package.json'));
if (!definition) {
return undefined;
}
this._definitions[packagePath] = definition;
this._definitions[normalizedPath] = definition;
}

@@ -58,6 +61,10 @@ if (disableTransforms) {

transformedDefinition =
(await transform({ definition: transformedDefinition, packagePath, packages: this, importerContext })) ||
transformedDefinition;
(await transform({
definition: transformedDefinition,
packagePath: normalizedPath,
packages: this,
importerContext,
})) || transformedDefinition;
}
this._transformedDefinitions[packagePath] = transformedDefinition;
this._transformedDefinitions[normalizedPath] = transformedDefinition;
}

@@ -99,6 +106,7 @@ return transformedDefinition;

resetPackage(packagePath) {
delete this._definitions[packagePath];
delete this._transformedDefinitions[packagePath];
const normalizedPath = slash(packagePath);
delete this._definitions[normalizedPath];
delete this._transformedDefinitions[normalizedPath];
}
}
//# sourceMappingURL=PackageDefinitions.js.map
{
"name": "@ms-cloudpack/package-utilities",
"version": "7.4.8",
"version": "7.4.9",
"description": "Utilities for resolving/parsing packages and their imports.",

@@ -17,7 +17,7 @@ "license": "MIT",

"dependencies": {
"@ms-cloudpack/common-types": "^0.5.4",
"@ms-cloudpack/common-types": "^0.6.0",
"@ms-cloudpack/json-utilities": "^0.1.4",
"@ms-cloudpack/package-overrides": "^0.8.6",
"@ms-cloudpack/package-overrides": "^0.8.7",
"@ms-cloudpack/path-string-parsing": "^1.2.2",
"@ms-cloudpack/path-utilities": "^2.7.11",
"@ms-cloudpack/path-utilities": "^2.7.12",
"@ms-cloudpack/task-reporter": "^0.14.1",

@@ -24,0 +24,0 @@ "acorn": "^8.11.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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