Socket
Book a DemoInstallSign in
Socket

@angular-architects/native-federation

Package Overview
Dependencies
Maintainers
5
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular-architects/native-federation - npm Package Compare versions

Comparing version

to
20.0.5

2

package.json
{
"name": "@angular-architects/native-federation",
"version": "20.0.4",
"version": "20.0.5",
"main": "src/index.js",

@@ -5,0 +5,0 @@ "generators": "./collection.json",

@@ -20,2 +20,3 @@ "use strict";

const json5_1 = tslib_1.__importDefault(require("json5"));
const node_util_1 = require("node:util");
let _memResultHandler;

@@ -208,3 +209,3 @@ function setMemResultHandler(handler) {

const tsconfigFedPath = path.join(tsconfigDir, 'tsconfig.federation.json');
if (!doesFileExist(tsconfigFedPath, content)) {
if (!doesFileExistAndJsonEqual(tsconfigFedPath, content)) {
fs.writeFileSync(tsconfigFedPath, JSON.stringify(tsconfig, null, 2));

@@ -215,2 +216,24 @@ }

}
/**
* Checks if a file exists and if its content is equal to the provided content.
* If the file does not exist, it returns false.
* If the file or its content is invalid JSON, it returns false.
* @param {string} path - The path to the file
* @param {string} content - The content to compare with
* @returns {boolean} - Returns true if the file exists and its content is equal to the provided content
*/
function doesFileExistAndJsonEqual(path, content) {
if (!fs.existsSync(path)) {
return false;
}
try {
const currentContent = fs.readFileSync(path, 'utf-8');
const currentJson = json5_1.default.parse(currentContent);
const newJson = json5_1.default.parse(content);
return (0, node_util_1.isDeepStrictEqual)(currentJson, newJson);
}
catch (_error) {
return false;
}
}
function doesFileExist(path, content) {

@@ -217,0 +240,0 @@ if (!fs.existsSync(path)) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.