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

@redpanda-data/docs-extensions-and-macros

Package Overview
Dependencies
Maintainers
9
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redpanda-data/docs-extensions-and-macros - npm Package Compare versions

Comparing version 3.5.5 to 3.5.6

20

extensions/replace-attributes-in-attachments.js
'use strict';
module.exports.register = function () {
const sanitizeAttributeValue = (value) => String(value).replace("@", "");
this.on('contentClassified', ({ contentCatalog }) => {

@@ -23,3 +24,19 @@ const componentVersionTable = contentCatalog.getComponents().reduce((componentMap, component) => {

let modified;
const result = attachment.contents.toString().replace(/\{([\p{Alpha}\d_][\p{Alpha}\d_-]*)\}/gu, (match, name) => {
let contentString = attachment.contents.toString();
// Specific replacements for YAML files
if (attachment.out.path.endsWith('.yaml') || attachment.out.path.endsWith('.yml')) {
const redpandaVersionRegex = /(\$\{REDPANDA_VERSION[^\}]*\})/g;
const redpandaConsoleVersionRegex = /(\$\{REDPANDA_CONSOLE_VERSION[^\}]*\})/g;
let fullVersion = attributes['full-version'] ? sanitizeAttributeValue(attributes['full-version']) : '';
const latestConsoleVersion = attributes['latest-console-version'] ? sanitizeAttributeValue(attributes['latest-console-version']) : '';
if (attributes['page-component-version-is-prerelease'] === 'true') {
fullVersion = attributes['redpanda-beta-version'] ? sanitizeAttributeValue(attributes['redpanda-beta-version']) : fullVersion;
}
contentString = contentString.replace(redpandaVersionRegex, fullVersion);
contentString = contentString.replace(redpandaConsoleVersionRegex, latestConsoleVersion);
}
const result = contentString.replace(/\{([\p{Alpha}\d_][\p{Alpha}\d_-]*)\}/gu, (match, name) => {
if (!(name in attributes)) return match;

@@ -31,2 +48,3 @@ modified = true;

});
if (modified) attachment.contents = Buffer.from(result);

@@ -33,0 +51,0 @@ });

2

package.json
{
"name": "@redpanda-data/docs-extensions-and-macros",
"version": "3.5.5",
"version": "3.5.6",
"description": "Antora extensions and macros developed for Redpanda documentation.",

@@ -5,0 +5,0 @@ "keywords": [

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