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

@lhci/utils

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lhci/utils - npm Package Compare versions

Comparing version 0.3.7 to 0.3.8

4

package.json
{
"name": "@lhci/utils",
"version": "0.3.7",
"version": "0.3.8",
"license": "Apache-2.0",

@@ -17,3 +17,3 @@ "repository": {

},
"gitHead": "3a34a7b0a9f57b78ec1d5c1be5263262408c61fa"
"gitHead": "2204f91151a2558a1ea3fe68677c5f6a9385747f"
}

@@ -14,2 +14,4 @@ /**

const RC_FILE_NAMES = [
'.lighthouserc.js',
'lighthouserc.js',
'.lighthouserc.json',

@@ -23,2 +25,3 @@ 'lighthouserc.json',

const JS_FILE_EXTENSION_REGEX = /\.(js)$/i;
const YAML_FILE_EXTENSION_REGEX = /\.(yml|yaml)$/i;

@@ -73,3 +76,8 @@

function parseFileContentToJSON(pathToRcFile, contents) {
// Check if file path ends in yaml or yml
// Check if file path ends in .js
if (JS_FILE_EXTENSION_REGEX.test(pathToRcFile)) {
return require(pathToRcFile);
}
// Check if file path ends in .yaml or .yml
if (YAML_FILE_EXTENSION_REGEX.test(pathToRcFile)) {

@@ -79,2 +87,4 @@ // Parse yaml content to JSON

}
// Fallback to JSON parsing
return JSON.parse(contents);

@@ -81,0 +91,0 @@ }

@@ -13,2 +13,3 @@ /**

const ASSERTION_RESULTS_PATH = path.join(LHCI_DIR, 'assertion-results.json');
const URL_LINK_MAP_PATH = path.join(LHCI_DIR, 'links.json');

@@ -104,2 +105,16 @@ function ensureDirectoryExists(baseDir = LHCI_DIR) {

/**
* @param {Map<string, string>} targetUrlMap
*/
function writeUrlMapToFile(targetUrlMap) {
/** @type {Record<string, string>} */
const urlMapAsObject = {};
for (const [testedUrl, link] of targetUrlMap.entries()) {
urlMapAsObject[testedUrl] = link;
}
fs.writeFileSync(URL_LINK_MAP_PATH, JSON.stringify(urlMapAsObject, null, 2));
}
module.exports = {

@@ -114,2 +129,3 @@ getHTMLReportForLHR,

replaceUrlPatterns,
writeUrlMapToFile,
};
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