Socket
Socket
Sign inDemoInstall

@ampproject/toolbox-optimizer

Package Overview
Dependencies
Maintainers
16
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ampproject/toolbox-optimizer - npm Package Compare versions

Comparing version 2.8.6 to 2.8.7

26

lib/fetchRuntimeParameters.js

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

const {MaxAge} = require('@ampproject/toolbox-core');
const JSON5 = require('json5');
let fallbackRuntime;

@@ -72,3 +71,3 @@

async function initValidatorRules(runtimeParameters, customRuntimeParameters, config) {
if (!config.autoExtensionImport) {
if (config.autoExtensionImport === false) {
// Validation rules are large, don't import if not needed

@@ -116,9 +115,4 @@ return;

const componentConfigUrl = `https://raw.githubusercontent.com/ampproject/amphtml/${releaseTag}/build-system/compile/bundles.config.extensions.json`;
const latestVersionsUrl = `https://raw.githubusercontent.com/ampproject/amphtml/${releaseTag}/build-system/compile/bundles.legacy-latest-versions.jsonc`;
const responses = await Promise.all([
config.fetch(componentConfigUrl),
config.fetch(latestVersionsUrl),
]);
const [configResponse, latestVersionsConfigResponse] = responses;
const configResponse = await config.fetch(componentConfigUrl);
if (!configResponse.ok) {

@@ -129,17 +123,3 @@ throw new Error(

}
if (!latestVersionsConfigResponse.ok) {
throw new Error(
`Failed fetching latest component versions from ${latestVersionsUrl} with status: ${latestVersionsConfigResponse.status}`
);
}
const extensionConfig = await configResponse.json();
const latestVersionsConfig = JSON5.parse(await latestVersionsConfigResponse.text());
// We add back the "latestVersion" field so that the auto importer
// code knows what "stable" version of the extension to use.
extensionConfig.forEach((entry) => {
entry['latestVersion'] = latestVersionsConfig[entry.name];
});
return extensionConfig;
return await configResponse.json();
}

@@ -146,0 +126,0 @@

5

package.json
{
"name": "@ampproject/toolbox-optimizer",
"version": "2.8.6",
"version": "2.8.7",
"description": "Server-side rendering for AMPs.",

@@ -41,3 +41,2 @@ "main": "index.js",

"https-proxy-agent": "5.0.0",
"json5": "^2.2.0",
"lru-cache": "6.0.0",

@@ -53,3 +52,3 @@ "normalize-html-whitespace": "1.0.0",

"homepage": "https://github.com/ampproject/amp-toolbox/tree/main/packages/optimizer",
"gitHead": "9e537758baa2424a96d920308df75eb24b6e3dec"
"gitHead": "7c5297fe6a977432eac8b2f606e43abf6550aec3"
}
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