Split a record in an object [closed]

I have this object:

{
Name:    "Jim"
Cars:    "BMW|NISSAN"
Numbers: "1|3"
},
{
Name:    "Mary"
Cars:    "DODGE|BMW"
Numbers: "2|3"
}

So Jim has 1 BMW and 3 Nissan. Mary has 2 Dodge and 3 BMW.
I need some simple “functionality” to transform this object to this:

{
Name:    "Jim"
Cars:    "BMW"
Numbers: "1"
},
{
Name:    "Jim"
Cars:    "NISSAN"
Numbers: "3"
},
{
Name:    "Mary"
Cars:    "DODGE"
Numbers: "2"
}
{
Name:    "Mary"
Cars:    "BMW"
Numbers: "3"
}

I don’t have the option to create the initial object in a different way. I have to deal with what I receive from the database and solve it in the FrontEnd (javascript).

Convert TXT to JSON in javascript

The application should:

  • Read data from a .txt file (e.g., weather:blabla:sunny).

  • Convert it to .json.

Problem:
During the .txt → .json conversion, the last segment (e.g., “sunny”) is being cut off.

.txt format:
Key before the first :, value after the second :, everything in between is irrelevant.

Conditions:

  • No external software, sensitive data.

Link to the application:
Google Drive
Run: In VS Code → terminal → npx electron.

Expected .txt format:
weather:blabla:sunny or (weather:blabla;blabla:sunny).

QUESTION How to make it so that after the second ‘:’ it reads the data into JSON, while the rest of the TXT file is being read correctly?
CODE:

const { ipcRenderer } = require("electron");

// Function to process data from a TXT file into a JSON object
const fs = require('fs');

// Function to convert TXT file content to JSON
function convertToJson(text) {
    console.log("Input data:", text); // For debugging
    
    const lines = text.split('n').filter(line => line.trim());
    const result = {};
    
    for (const line of lines) {
      console.log("Processed line:", line); // For debugging
      
      // Skip empty lines
      if (!line.trim()) continue;
      
      // Find the position of the first colon
      const firstColonIndex = line.indexOf(':');
      
      // If there’s no colon, skip to the next line
      if (firstColonIndex === -1) continue;
      
      // Extract the key (before the first colon)
      const key = line.substring(0, firstColonIndex).trim();
      
      // Extract the full value after the first colon
      const fullValue = line.substring(firstColonIndex + 1);
      
      console.log(`Found key: "${key}", value: "${fullValue}"`); // For debugging
      
      // Save to the result object
      result[key] = fullValue.trim();
    }
    
    console.log("JSON result:", result); // For debugging
    return result;
  }
  
  // Test
  const testData = "weather:sunny:flower";
  const result = convertToJson(testData);
  console.log(JSON.stringify(result, null, 2));
    
  
// "Select TXT File" button
document.getElementById("selectFile").addEventListener("click", async () => {
    console.log("Clicked 'Select TXT File'");
    const fileContent = await ipcRenderer.invoke("open-file");
    if (fileContent) {
        console.log("File content:", fileContent);
        document.getElementById("fileContent").innerText = JSON.stringify(fileContent, null, 2);
    }
});

// "Save as DOCX" button
document.getElementById("convertToDocx").addEventListener("click", async () => {
    console.log("Clicked 'Save as DOCX'");

    // Transform the content into a JSON object
    const fileContent = document.getElementById("fileContent").innerText;
    const data = JSON.parse(fileContent);  // Convert text to a JSON object
    
    await ipcRenderer.invoke("save-docx", data);  // Send the data object
    alert("DOCX file has been saved!");
});

dialog with role=’dialog’ causing screen reader to announce all content despite setting focus on specific element

I’m implementing an accessible profile menu in Vue 3 using v-menu with role=”dialog”. When the menu opens, I’m setting focus on a specific element, but the screen reader (specify which one: NVDA, JAWS, VoiceOver, etc.) is announcing all content in the dialog instead of just the focused element.

<div class="d-sm-flex d-md-flex justify-end align-center menu-items">
                <v-menu v-model="menu" :close-on-content-click="false" location="bottom"
                  class="profile-card" @update:modelValue="handleMenuToggle">
                  <template v-slot:activator="{ props }">
                    <v-btn color="indigo" v-bind="props" class="profile-btn" role="button" id="profile-menu-button"
                      @click="openProfileMenu" aria-labelledby="profileLabel userName userRoleText"
                      :aria-expanded="menu" aria-haspopup="dialog" ref="profileButton">
                      <img src="/images/user.svg" alt="" aria-hidden="true" />
                      <div class="d-none d-sm-flex flex-column align-start">
                        <span id="profileLabel" class="sr-only">{{ t('profile') }}</span>
                        <span class="font-16 font-700 color-white" id="userName">{{ store?.user?.name }}</span>
                        <span class="font-14 font-400 color-white" id="userRoleText">{{ userRole }}</span>
                      </div>
                    </v-btn>
                  </template>
                  <v-card min-width="380" role="dialog" aria-modal="true" aria-label="Profile Mega Menu" ref="menuCard"
                    @keydown.escape="closeProfileMenu">
                    <div class="header text-right pa-6 pr-8 py-0">
                      <button id="close-profile-menu" @click="closeProfileMenu" :aria-label="ariaLabelData.closeProfile"
                        class="cursor-pointer close-icon" ref="closeButton">
                        <img src="/images/close-icon.svg" alt="" aria-hidden="true" />
                      </button>
                    </div>
                    <div class="uesrname" aria-labelledby="profileLabelInner userNameInner userRoleTextInner"
                      tabindex="0">
                      <div class="user-profile">
                        <span id="profileLabelInner" class="sr-only">{{ t('profile') }}</span>
                        <p id="userNameInner" class="font-16 font-600 name">{{ store?.user?.fullName }}</p>
                        <p id="userRoleTextInner" class="font-12 font-400 role">{{ userRole }}</p>
                      </div>
                    </div>
                    <div class="profileMenu">
                      <div 
                       
                        @click="closeMenu" 
                        :aria-label="ariaLabelData.myProfile" 
                        tabindex="0"
                        id="my-profile-button" 
                        ref="myProfileButton"
                        class="profileMenu__item">
                        <img src="/public/images/user-blue.svg" class="mr-4" alt="" aria-hidden="true" />
                        <span aria-hidden="true">{{ t('myProfile') }}</span>
                      </div>
                    
                      <div
                        v-if="store?.user?.roles.includes('PARTNER_ADMIN') || store?.user?.roles.includes('ADMIN') || store?.user?.roles.includes('SUB_ADMIN')"
                        @click="redirectToDashboard" 
                        class="profileMenu__item profileMenu__item--dashboard" 
                        :aria-label="ariaLabelData.dashboard"
                        tabindex="0">
                        <div class="profileMenu__item-wrapper">
                          <div class="profileMenu__item-primary">
                            <img src="/public/images/dashboard.svg" class="mr-4" alt="" aria-hidden="true" />
                            <span aria-hidden="true">{{ t('dashboard') }}</span>
                          </div>
                          <div class="profileMenu__item-secondary">
                            <img src="/public/images/action-icon.svg" alt="" aria-hidden="true" />
                          </div>
                        </div>
                      </div>
                    
                      <div
                        v-if="(store?.user?.roles.includes('PARTNER_ADMIN') || store?.user?.roles.includes('ADMIN')) && store?.user?.profileConfiguration?.enabled"
                        @click="redirectToProfile" 
                        class="profileMenu__item profileMenu__item--profile" 
                        :aria-label="ariaLabelData.profilePage"
                        tabindex="0">
                        <div class="profileMenu__item-wrapper">
                          <div class="profileMenu__item-primary">
                            <img src="/public/images/corporate-icon.svg" class="mr-4" alt="" aria-hidden="true" />
                            <span aria-hidden="true">{{ t('profilePage') }}</span>
                          </div>
                          <div class="profileMenu__item-secondary">
                            <img src="/public/images/action-icon.svg" alt="" aria-hidden="true" />
                          </div>
                        </div>
                      </div>
                    
                      <div
                        @click="closeMenu" 
                        class="profileMenu__item" 
                        :aria-label="ariaLabelData.mfasettings"
                        tabindex="0">
                        <img src="/public/images/mfa-setting.svg" class="mr-4" alt="" aria-hidden="true" />
                        <span aria-hidden="true">{{ t('mfasettings') }}</span>
                      </div>
                    </div>
                    <v-card-actions>
                      <v-btn variant="text" @click="signout" :aria-label="ariaLabelData.signout" role="button"
                        tabindex="0">
                        {{ t('signout') }}
                        <img src="/public/images/arrow-blue-right.svg" class="ml-2" alt="" aria-hidden="true" />
                      </v-btn>
                    </v-card-actions>
                  </v-card>
                </v-menu>
              </div>

Expected behavior: When the dialog opens and focus is set on the my profile button, only that button should be announced by the screen reader.

Actual behavior: The screen reader announces all focusable elements within the dialog, even though focus is properly trapped and set on the my profile button.

What I’ve tried:

  • Setting aria-modal=”true”
  • Using trapFocus() to contain focus within the dialog
  • Setting explicit focus on the my profile button with a delay

Is there something specific about Vue’s rendering or the way screen readers interact with dynamically created dialogs that I’m missing?

Organizational chart using d3 in Angular

Angular version 16; D3 version 7.9.0; D3-org-chart version 3.1.1… I created a chart of organization. But I would want to provide the organizational chart a zoom-in and zoom-out function.

I added the code for zoom-in and zoom-out feature but when zoom-in or out the chart disappeared.

I don’t know how to set the zoom-in ,zoom-out limitations for organizational chart.

HTML code

<div id="orgchart" class="chart-container"></div>


SCSS code

#orgchart {

    .node .label {
        fill: green !important;
    }

    .node .title {
        fill: red !important;
    }

    .node rect {
        fill: lightblue !important;
    }

    svg {
        background-color: rgb(213, 219, 220);
    }

    ::ng-deep.node-button-div {
        width: 134% !important;
    }


    // ::ng-deep svg.svg-chart-container {
    //     height: 200vh !important;
    // }

    ::ng-deep svg.svg-chart-container {
        height: auto !important;
        width: auto !important;

    }

}




TS code

import {
    OnChanges,
    Component,
    OnInit,
    Input,
    ViewChild,
    ElementRef,
} from '@angular/core';
import * as d3 from 'd3';
import { HierarchyNode } from 'd3';
import { OrgChart, State } from 'd3-org-chart';



@Component({
    selector: 'app-org-chart',
    templateUrl: './org-chart.component.html',
    styleUrls: ['./org-chart.component.scss']
})
export class OrgChartComponent implements OnInit, OnChanges {
    @ViewChild("chartContainer") chartContainer: ElementRef | undefined;
    @Input() data: any[] | undefined;
    chart: any;
    datas: any[] = [];
    constructor() { }

    ngOnInit() {





        const res = {
            data: [
                {
                    id: 1,
                    pos_name: 'KITTING PROCESS',
                    size: '',
                    parentId: 0,
                    member: 'Mani.N  (027)',
                    imgname: null,
                    desig_id: 1,
                    desig_name: 'Managing Director',
                    file_path: null,
                    // status: 'inprogress',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },
                {
                    id: 2,
                    pos_name: 'ASSEMBLY PROCESS',
                    size: '',
                    parentId: 0,
                    // member: 'Soumen Deb  (142)',
                    imgname: null,
                    desig_id: 2,
                    // desig_name: 'Test27_desig',
                    file_path: null,
                    // status: 'pending',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },
                {
                    id: 3,
                    pos_name: 'TESTING PROCESS',
                    size: '',
                    parentId: 0,
                    // member: 'Tanmoy Ghosh  (341)',
                    imgname: null,
                    desig_id: 3,
                    // desig_name: 'Manager-Laser Customer Relations',
                    file_path: null,
                    // status: 'completed',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },
                {
                    id: 4,
                    pos_name: 'Dry Process',
                    size: '',
                    parentId: 1,
                    // member: 'Tanmoy Ghosh  (341)',
                    imgname: null,
                    desig_id: 4,
                    // desig_name: 'Manager-Laser Customer Relations',
                    file_path: null,
                    // status: 'completed',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },
                {
                    id: 5,
                    pos_name: 'Wet Process',
                    size: '',
                    parentId: 1,
                    // member: 'Tanmoy Ghosh  (341)',
                    imgname: null,
                    desig_id: 4,
                    // desig_name: 'Manager-Laser Customer Relations',
                    file_path: null,
                    // status: 'pending',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },

                {
                    id: 6,
                    pos_name: 'Radix Lab to Fab Products',
                    size: '',
                    parentId: 1,
                    // member: 'Tanmoy Ghosh  (341)',
                    imgname: null,
                    desig_id: 6,
                    // desig_name: 'Manager-Laser Customer Relations',
                    file_path: null,
                    // status: 'inprogress',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },

                {
                    id: 7,
                    pos_name: "Strategic Technology Platforms",
                    size: "",
                    parentId: 1,
                    member: "Sanjay.G  (476)",
                    imgname: null,
                    desig_id: 73,
                    desig_name: "Senior Officer - Costing",
                    file_path: null,
                    // status: 'completed',
                    imageUrl: "http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png"
                },
                {
                    id: 8,
                    pos_name: 'Dry Process',
                    size: '',
                    parentId: 2,
                    // member: 'Tanmoy Ghosh  (341)',
                    imgname: null,
                    desig_id: 4,
                    // desig_name: 'Manager-Laser Customer Relations',
                    file_path: null,
                    // status: 'completed',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },
                {
                    id: 9,
                    pos_name: 'Wet Process',
                    size: '',
                    parentId: 2,
                    // member: 'Tanmoy Ghosh  (341)',
                    imgname: null,
                    desig_id: 4,
                    // desig_name: 'Manager-Laser Customer Relations',
                    file_path: null,
                    // status: 'pending',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },

                {
                    id: 10,
                    pos_name: 'Radix Lab to Fab Products',
                    size: '',
                    parentId: 2,
                    // member: 'Tanmoy Ghosh  (341)',
                    imgname: null,
                    desig_id: 6,
                    // desig_name: 'Manager-Laser Customer Relations',
                    file_path: null,
                    // status: 'inprogress',
                    imageUrl:
                        'http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png',
                },

                {
                    id: 11,
                    pos_name: "Strategic Technology Platforms",
                    size: "",
                    parentId: 2,
                    member: "Sanjay.G  (476)",
                    imgname: null,
                    desig_id: 73,
                    desig_name: "Senior Officer - Costing",
                    file_path: null,
                    // status: 'completed',
                    imageUrl: "http://103.154.184.122:8080/kpi_api_dev/authenticate/profileimage/user.png"
                },
             
                {
                    id: 0,
                    pos_name: "YES",
                    size: "",
                    parentId: "",
                    member: "Organizational Chart",

                    desig_id: 73,
                    desig_name: "",

                }
            ]
        }



        console.log('Org Chart Data:', res.data);
        console.log('ID type:', typeof res.data[0].id, 'ParentID type:', typeof res.data[0].parentId);
        console.log('IDs:', res.data.map(item => item.id));
        res.data.forEach(item => {
            if (item.id === null || item.id === undefined || item.parentId === null || item.parentId === undefined) {
                console.log('Null or undefined found:', item);
            }
        });

        if (res) {
            const chartContainer = d3.select('.chart-container');
            chartContainer.append('defs')
                .append('clipPath')
                .attr('id', 'clip')
                .append('rect')
                .attr('width', '100%')
                .attr('height', '100%');
            this.chart = new OrgChart()
                .container('.chart-container')
                .layout('left')
                .data(res.data)
                .nodeWidth((d: any) => 300)
                .initialZoom(0.8)
                .nodeHeight((d: any) => 175)


                .buttonContent(
                    ({
                        node,
                        state,
                    }: {
                        node: HierarchyNode<any>;
                        state: State<any>;
                    }) => {
                        return `<div style="color:#fff;    border-radius: 5px;
    padding: 3px 9px 3px 8px;font-size:10px;margin:auto auto;background-color:#007672;border: 1px solid #007672">
    <span style="font-size:14px">
    ${node.data._directSubordinates}
        ${node.children
                                ? `<i class="fa fa-angle-up"></i>`
                                : `<i class="fa fa-angle-down"></i>`
                            }
    </span>

    </div>`;
                    }
                )
                .linkUpdate((d: any, i: any, arr: any) => {
                    const selection = d3.select('.chart-container');
                    const strokeColor = '#007672';
                    const strokeWidth = d.data._upToTheRootHighlighted ? 15 : 1;
                    selection.style('stroke', strokeColor);
                    selection.attr('stroke-width', strokeWidth);


                    if (d.data._upToTheRootHighlighted) {
                        selection.raise();
                    }
                })
                .childrenMargin((d: any) => 50)
                .compactMarginBetween((d: any) => 35)
                .compactMarginPair((d: any) => 90)
                .nodeContent(function (
                    d: HierarchyNode<any>,
                    i: number,
                    arr: HierarchyNode<any>[],
                    state: State<any>
                ) {
                    const nodeWithWidth = d as HierarchyNode<any> & { width: number };
                    const imageUrl = d.data.imageUrl ? d.data.imageUrl : 'assets/masters/user.jpg';

                    let borderColor = 'lightgray'; // Default border color

                    if (d.data.status === 'pending') {
                        borderColor = 'orange';
                    } else if (d.data.status === 'inprogress') {
                        borderColor = 'blue';
                    } else if (d.data.status === 'completed') {
                        borderColor = 'green';
                    }
                    return `

    

    <div style="padding-top:0px;background-color:none;    border-radius: 20px; margin-left:1px;height:${d.height}px;border-radius:2px;overflow:visible">
    <div style="height:inherit;padding-top:0px;background-color:white;border:5px solid ${borderColor};    border-radius: 20px;">
    <div
    class="col-xs-12 col-sm-12 col-md-12 col-lg-12 row m-0 p-0"
    style="
      background: #ffffff 0% 0% no-repeat padding-box;
      box-shadow: 0px 3px 6px #00000029;
      height: inherit;
      width: inherit;
  border-radius: 20px;
    "
    >
    
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 row m-0 p-3">
      <div
        class="col-xs-12 col-sm-12 col-md-12 col-lg-12 row m-0 d-flex align-items-center p-0"
      >
        <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 p-0">
          <img src="assets/card/profile1.png" style="width: 70px; height: 70px;border-radius: 50%;" />
        </div>
        <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9 p-0">
          <div
            class="col-xs-12 col-sm-12 col-md-12 col-lg-12 d-flex flex-column ms-4"
          >
            <div
              class="col-xs-12 col-sm-12 col-md-12 col-lg-12 pt-2 d-flex justify-content-start fw-bolder"
            >
            ${d.data.pos_name}
            </div>

              <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 py-1 fw-light " style="color: #007672;">
            ${d.data.desig_name}
            </div>

            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 py-1 fw-light "  style="color: #868585;">
            ${d.data.member}
            </div>
          
          </div>
        </div>
      </div>

    </div>`;
                })

            const zoom: any = d3
                .zoom<SVGSVGElement, any>()
                .scaleExtent([1, 10])
                .on('zoom', (event: any) => {
                    chartContainer.attr('transform', event.transform);
                });
            chartContainer.call(zoom);

            console.log("Chart after expandAll:", this.chart);
            console.log("Chart after render:", this.chart);
            this.chart.expandAll();

            this.chart.render();






        }

    }


    ngAfterViewInit() {
        if (!this.chart) {

        }
        this.updateChart();
    }



    ngOnChanges() {
        this.updateChart();
    }
    updateChart() {
        if (!this.data) {
            return;
        }
        if (!this.chart) {
            return;
        }
        this.chart
            .container('.chart-container')
            .data(this.data)
            .svgWidth(500)

            .onNodeClick((d: any) => console.log(d + ' node clicked'))
            .render();
    }


}

How can I implement Markdown in Javascript for Bold and italic

I’m trying to implement this for bold and italic markdown styles, upon selecting individual text or entire sentence the style should be applied and toggled but with my current code its not working as expected.

If i write a sentence and select each word with bold or italic and hit send its giving correct output, but when i select all and click bold or italic the previous styles are overidden and everything changes to selected style.

I want the output to be proper irrespective of any testcase that user performs on these buttongs.

Markdown syntax link

I have the below code, and trying to add this markdown feature to a chat window.. hence a mock code.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Text Editor with Toggle Bold/Italic</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="editor-container">
        <div class="toolbar">
            <button onclick="toggleStyle('bold')">Bold</button>
            <button onclick="toggleStyle('italic')">Italic</button>
        </div>
        <div contenteditable="true" id="textbox" class="textbox"></div>
        <button onclick="convertToMarkdown()">Send</button>
    </div>
    <div class="output" id="output"></div>
 
    <script src="script.js"></script>
</body>
</html>

body {
    font-family: Arial, sans-serif;
    text-align: center;
    margin-top: 50px;
}
 
.editor-container {
    display: inline-block;
    text-align: left;
    border: 1px solid #ccc;
    padding: 10px;
    width: 300px;
}
 
.toolbar {
    margin-bottom: 5px;
}
 
.toolbar button {
    margin-right: 5px;
    padding: 5px 10px;
    cursor: pointer;
}
 
.textbox {
    width: 100%;
    min-height: 100px;
    border: 1px solid #ccc;
    padding: 5px;
    outline: none;
}
 
.output {
    margin-top: 10px;
    font-weight: bold;
}
 
.bold {
    font-weight: bold;
}
 
.italic {
    font-style: italic;
}

function toggleStyle(style) {
    const selection = window.getSelection();
    if (!selection.rangeCount) return;
 
    const range = selection.getRangeAt(0);
    const selectedText = range.toString().trim();
    if (!selectedText) return;
 
    let parentSpan = range.commonAncestorContainer.parentElement;
    let shouldRemoveStyle = false;
 
    if (parentSpan.tagName === "SPAN") {
        if (parentSpan.classList.contains(style)) {
            // Remove style if it's already applied
            parentSpan.classList.remove(style);
            shouldRemoveStyle = true;
        }
    }
 
    if (!shouldRemoveStyle) {
        // Apply new style only to selected text
        const span = document.createElement("span");
        span.classList.add(style);
        span.textContent = selectedText;
        range.deleteContents();
        range.insertNode(span);
    }
 
    // Remove empty spans
    document.querySelectorAll(".textbox span").forEach(el => {
        if (el.classList.length === 0) {
            el.replaceWith(el.textContent);
        }
    });
 
    selection.removeAllRanges();
}
 
function convertToMarkdown() {
    const textbox = document.getElementById("textbox");
    let rawHTML = textbox.innerHTML;
 
    // Step 1: Handle bold + italic first
    rawHTML = rawHTML.replace(/<span class="bold italic">(.*?)</span>/g, "***$1***");
 
    // Step 2: Handle only bold (after bold+italic is processed)
    rawHTML = rawHTML.replace(/<span class="bold">(.*?)</span>/g, "**$1**");
 
    // Step 3: Handle only italic (after bold+italic is processed)
    rawHTML = rawHTML.replace(/<span class="italic">(.*?)</span>/g, "_$1_");
 
    // Step 4: Ensure no redundant markdown (**_text_** → ***text***)
    rawHTML = rawHTML.replace(/**_([^_*]+)_**/g, "***$1***");
    rawHTML = rawHTML.replace(/_**([^_*]+)**_/g, "***$1***");
 
    // Step 5: Ensure no extra symbols (fixes issues like __text****)
    rawHTML = rawHTML.replace(/_{2,}([^_]+)_{2,}/g, "_$1_"); // Fixes __text__ → _text_
    rawHTML = rawHTML.replace(/*{4,}([^*]+)*{4,}/g, "***$1***"); // Fixes ****text**** → ***text***
 
    document.getElementById("output").innerText = "Markdown Output: " + rawHTML;
}

expecting the correct output for user’s action on bold and italic styles providing me the right markdown string

check box Javascript Function

I have this view:

@model Progetto2.Modell.CreateUtentecs

@{
    ViewBag.Title = "GrigliaFormUtente";
}
<script type="text/javascript">
    function validazioneCampi() {
        const cognome = document.getElementById('Cognome').value.trim();
        const nome = document.getElementById('Nome').value.trim();
        const comuneId = document.getElementById('ComuneId').value;
        const sesso = document.getElementById('Sesso').value.trim();
        const professioniID = document.getElementById('ProfessioniID').value;
        const error = document.getElementById('error');

        let messages = "";

        if (cognome === "") messages = "Inserire un Cognome";
        if (nome === "") messages = "Inserire un Nome";
        if (sesso === "") messages = "Inserire il Sesso";

        if (messages !== "") {
            error.innerHTML = "<span style='color:red;'>" + messages + "</span>";
            return;
        }

        const proprietaIds = [];
        document.querySelectorAll('input[name="ProprietaIds"]:checked').forEach(function (checkbox) {
            proprietaIds.push(checkbox.value);
        });

        $.ajax({
            type: 'POST',
            url: '/Utentes/CreaUtente',
            data: {
                Cognome: cognome,
                Nome: nome,
                ComuneId: comuneId,
                Sesso: sesso,
                ProfessioniID: professioniID,
                ProprietaIds: proprietaIds
            },
            success: function (response) {
                $('#result').html(response);
                error.innerHTML = "";
            },
            error: function () {
                error.innerHTML = "<span style='color:red;'>Errore nell'inserimento</span>";
            }
        });
    }
    </script>

<h2>Aggiungi un Nuovo Utente</h2>
<hr />

<div class="row">
    <div class="col-md-4">
        <form id="form_1" action="@Url.Action("CreaUtente1", "Utentes")" method="post">
            <div class="form-group">
                <label>Cognome</label>
                @Html.TextBoxFor(m => m.Cognome, new { @class = "form-control", id = "Cognome" })
            </div>
            <br />

            <div class="form-group">
                <label>Nome</label>
                @Html.TextBoxFor(m => m.Nome, new { @class = "form-control", id = "Nome" })
            </div>
            <br />

            <div class="form-group">
                <label>Comune</label>
                @Html.DropDownListFor(m => m.ComuneId,
                              Model.ListaComuni.Select(m => new SelectListItem
                              {
                                  Value = m.Id.ToString(),
                                  Text = m.NomeComune
                              }), new { @class = "form-control", id = "ComuneId" })
            </div>
            <br />

            <div class="form-group">
                <label>Sesso</label>
                @Html.TextBoxFor(m => m.Sesso, new { @class = "form-control", id = "Sesso" })
            </div>
            <br />

            <div class="form-group">
                <label>Professione</label>
                @Html.DropDownListFor(m => m.ProfessioneId,
                              Model.ListaProfessioni.Select(m => new SelectListItem
                              {
                                  Value = m.ID.ToString(),
                                  Text = m.NomeProfessione
                              }), new { @class = "form-control", id = "ProfessioniID" })
            </div>
            <br />

            <div class="form-group">
                <label>Proprietà</label>
                <div>
                    @foreach (var prop in Model.listProp)
                    {
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="ProprietaIds" value="@prop.Id" /> @prop.Oggetto_Di_Proprieta
                            </label>
                        </div>
                    }
                </div>
            </div>
            <br />

            <div class="form-group">
                <input type="button" onclick="validazioneCampi()" value="Aggiungi" class="btn btn-primary" />
            </div>
        </form>

        <div id="error"></div>
        <br />
        <div id="result"></div>
    </div>
</div>

and this other view:

@model Progetto2.Modell.CreateUtentecs

@{
    ViewBag.Title = "GrigliaFormUtente";
}
<script type="text/javascript">
    function validazioneCampi() {
        const cognome = document.getElementById('Cognome').value.trim();
        const nome = document.getElementById('Nome').value.trim();
        const comuneId = document.getElementById('ComuneId').value;
        const sesso = document.getElementById('Sesso').value.trim();
        const professioniID = document.getElementById('ProfessioniID').value;
        const error = document.getElementById('error');

        let messages = "";

        if (cognome === "") messages = "Inserire un Cognome";
        if (nome === "") messages = "Inserire un Nome";
        if (sesso === "") messages = "Inserire il Sesso";

        if (messages !== "") {
            error.innerHTML = "<span style='color:red;'>" + messages + "</span>";
            return;
        }

        const proprietaIds = [];
        document.querySelectorAll('input[name="ProprietaIds"]:checked').forEach(function (checkbox) {
            proprietaIds.push(checkbox.value);
        });

        $.ajax({
            type: 'POST',
            url: '/Utentes/CreaUtente',
            data: {
                Cognome: cognome,
                Nome: nome,
                ComuneId: comuneId,
                Sesso: sesso,
                ProfessioniID: professioniID,
                ProprietaIds: proprietaIds
            },
            success: function (response) {
                $('#result').html(response);
                error.innerHTML = "";
            },
            error: function () {
                error.innerHTML = "<span style='color:red;'>Errore nell'inserimento</span>";
            }
        });
    }
    </script>

<h2>Aggiungi un Nuovo Utente</h2>
<hr />

<div class="row">
    <div class="col-md-4">
        <form id="form_1" action="@Url.Action("CreaUtente1", "Utentes")" method="post">
            <div class="form-group">
                <label>Cognome</label>
                @Html.TextBoxFor(m => m.Cognome, new { @class = "form-control", id = "Cognome" })
            </div>
            <br />

            <div class="form-group">
                <label>Nome</label>
                @Html.TextBoxFor(m => m.Nome, new { @class = "form-control", id = "Nome" })
            </div>
            <br />

            <div class="form-group">
                <label>Comune</label>
                @Html.DropDownListFor(m => m.ComuneId,
                              Model.ListaComuni.Select(m => new SelectListItem
                              {
                                  Value = m.Id.ToString(),
                                  Text = m.NomeComune
                              }), new { @class = "form-control", id = "ComuneId" })
            </div>
            <br />

            <div class="form-group">
                <label>Sesso</label>
                @Html.TextBoxFor(m => m.Sesso, new { @class = "form-control", id = "Sesso" })
            </div>
            <br />

            <div class="form-group">
                <label>Professione</label>
                @Html.DropDownListFor(m => m.ProfessioneId,
                              Model.ListaProfessioni.Select(m => new SelectListItem
                              {
                                  Value = m.ID.ToString(),
                                  Text = m.NomeProfessione
                              }), new { @class = "form-control", id = "ProfessioniID" })
            </div>
            <br />

            <div class="form-group">
                <label>Proprietà</label>
                <div>
                    @foreach (var prop in Model.listProp)
                    {
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" name="ProprietaIds" value="@prop.Id" /> @prop.Oggetto_Di_Proprieta
                            </label>
                        </div>
                    }
                </div>
            </div>
            <br />

            <div class="form-group">
                <input type="button" onclick="validazioneCampi()" value="Aggiungi" class="btn btn-primary" />
            </div>
        </form>

        <div id="error"></div>
        <br />
        <div id="result"></div>
    </div>
</div>

and this are the main methods of my service:

public List<Utente> GetUtentiConProprieta()
{
    List<Utente> listaUtenti = new List<Utente>();

    using (SqlConnection conn = new SqlConnection(_connString))
    {
        try
        {
            conn.Open();

            // Query con STUFF per concatenare le proprietà
            string query = @"
                      SELECT a.Id, a.Cognome, a.Nome, c.NomeComune, a.Sesso, p.Professione,
                      STUFF((
                      SELECT ', ' +prv.proprieta
                      FROM uv_anagraficaproprietavendute prv
                      WHERE prv.anagraficaid = a.Id
                      FOR XML PATH ('') 
                      ), 1, 2, '') AS ProprietaVendute,
                      STUFF((
                      SELECT ', ' +pra.proprieta
                      FROM uv_anagraficaproprietaacquistate pra
                      WHERE pra.anagraficaid = a.Id
                      FOR XML PATH ('') 
                      ), 1, 2, '') AS ProprietaAcquistate,
                      STUFF((
                      SELECT ', ' +pr.proprieta
                      FROM uv_anagraficaproprieta pr
                      WHERE pr.anagraficaid = a.Id
                      FOR XML PATH ('') 
                      ), 1, 2, '') AS ProprietaAssegnate
                      FROM uv_anagrafica a
                      LEFT JOIN Comuni c ON a.ComuneId = c.id 
                      LEFT JOIN professioni p ON a.ProfessioniID = p.id;";

            SqlCommand cmd = new SqlCommand(query, conn);
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                listaUtenti.Add(new Utente
                {
                    Id = Convert.ToInt32(reader["Id"]),
                    Cognome = reader["Cognome"].ToString(),
                    Nome = reader["Nome"].ToString(),
                    NomeComune = reader["NomeComune"].ToString(),
                    Sesso = reader["Sesso"].ToString(),
                    Professione = reader["professione"].ToString(),
                    ProprietaVendute = reader["ProprietaVendute"] != DBNull.Value ? reader["ProprietaVendute"].ToString() : "Nessuna",
                    ProprietaAcquistate = reader["ProprietaAcquistate"] != DBNull.Value ? reader["ProprietaAcquistate"].ToString() : "Nessuna",
                    Proprieta = reader["ProprietaAssegnate"] != DBNull.Value ? reader["ProprietaAssegnate"].ToString() : "Nessuna"
                });
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("Errore: " + ex.Message);
        }
    }

    return listaUtenti;
}
public List<Utente> AggiornaListaUtenti()
{
    List<Utente> lista = new List<Utente>();
    string connString = "Server=svrsql2016;Database=esercizoanagrafica;User Id=usertest;Password=usertest;TrustServerCertificate=true;";

    using (SqlConnection conn = new SqlConnection(connString))
    {
        try
        {
            conn.Open();
            string query = "SELECT * FROM uv_anagrafica";
            SqlCommand cmd = new SqlCommand(query, conn);
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                lista.Add(new Utente
                {
                    Id = Convert.ToInt32(reader["Id"]),
                    Cognome = reader["Cognome"].ToString(),
                    Nome = reader["Nome"].ToString(),
                    NomeComune = reader["NomeComune"].ToString(),
                    Sesso = reader["Sesso"].ToString(),
                    Professione = reader["Professione"].ToString()
                });
            }
            conn.Close();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Errore: " + ex.Message);
        }
    }
    return lista;
}


public void AggiornaUtente(int id, string Cognome, string Nome, int NomeComuneId, int ProfessioneId, string Sesso, List<int> ProprietaId)
{
    using (SqlConnection conn = new SqlConnection(_connString))
    {
        conn.Open();
        using (var transaction = conn.BeginTransaction()) 
        {
            try
            {
                // Aggiorna dati utente
                string query = @"UPDATE Anagrafica 
                         SET Cognome = @Cognome, Nome = @Nome, ComuneId = @ComuneId, 
                             Sesso = @Sesso, ProfessioniID = @ProfessioneId 
                         WHERE id = @id";

                using (SqlCommand cmd = new SqlCommand(query, conn, transaction))
                {
                    cmd.Parameters.AddWithValue("@id", id);
                    cmd.Parameters.AddWithValue("@Cognome", Cognome);
                    cmd.Parameters.AddWithValue("@Nome", Nome);
                    cmd.Parameters.AddWithValue("@ComuneId", NomeComuneId);
                    cmd.Parameters.AddWithValue("@Sesso", Sesso);
                    cmd.Parameters.AddWithValue("@ProfessioneId", ProfessioneId);
                    cmd.ExecuteNonQuery();
                }

                // Ottieni proprietà attuali
                List<int> proprietaAttuali = new List<int>();
                string selectQuery = "SELECT proprietaId FROM anagraficaProprieta WHERE anagraficaId = @id";

                using (SqlCommand selectCmd = new SqlCommand(selectQuery, conn, transaction))
                {
                    selectCmd.Parameters.AddWithValue("@id", id);
                    using (SqlDataReader reader = selectCmd.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            proprietaAttuali.Add(reader.GetInt32(0));
                        }
                    }
                }

                // Trova proprietà da rimuovere 
                var proprietaDaRimuovere = proprietaAttuali.Where(p => !ProprietaId.Contains(p)).ToList();
                if (proprietaDaRimuovere.Any())
                {
                    string deleteQuery = "DELETE FROM anagraficaProprieta WHERE anagraficaId = @id AND proprietaId = @propId";
                    string insertSoldQuery = "INSERT INTO anagraficaproprietavendute (anagraficaid, proprietaid) VALUES (@id, @propId)";
                    foreach (int propId in proprietaDaRimuovere)
                    {
                        using (SqlCommand deleteCmd = new SqlCommand(deleteQuery, conn, transaction))
                        {
                            deleteCmd.Parameters.AddWithValue("@id", id);
                            deleteCmd.Parameters.AddWithValue("@propId", propId);
                            deleteCmd.ExecuteNonQuery();
                        }
                        using (SqlCommand insertCmd = new SqlCommand(insertSoldQuery, conn, transaction))
                        {
                            insertCmd.Parameters.AddWithValue("@id", id);
                            insertCmd.Parameters.AddWithValue("@propId", propId);
                            insertCmd.ExecuteNonQuery();
                        }
                    }
                }

                // Trova nuove proprietà da aggiungere
                var proprietaDaAggiungere = ProprietaId.Where(p => !proprietaAttuali.Contains(p)).ToList();
                if (proprietaDaAggiungere.Any())
                {
                    string insertQuery = "INSERT INTO anagraficaProprieta (anagraficaId, proprietaId) VALUES (@id, @propId)";
                    string insertPurchaseQuery = "INSERT INTO anagraficaproprietaacquistate (anagraficaId, proprietaId) VALUES (@id, @propId)";
                    foreach (int propId in proprietaDaAggiungere)
                    {
                        using (SqlCommand insertCmd = new SqlCommand(insertQuery, conn, transaction))
                        {
                            insertCmd.Parameters.AddWithValue("@id", id);
                            insertCmd.Parameters.AddWithValue("@propId", propId);
                            insertCmd.ExecuteNonQuery();
                        }
                        using (SqlCommand insertCmd = new SqlCommand(insertPurchaseQuery, conn, transaction))
                        {
                            insertCmd.Parameters.AddWithValue("@id", id);
                            insertCmd.Parameters.AddWithValue("@propId", propId);
                            insertCmd.ExecuteNonQuery();
                        }
                    }
                }

                transaction.Commit();
            }
            catch (Exception ex)
            {
                transaction.Rollback();
                Console.WriteLine("Errore AggiornaUtente: " + ex.Message);
            }
        }
    }
}

public int CreaUtente(string Cognome, string Nome, int ComuneId, int ProfessioniID, string Sesso, List<int> ProprietaIds)
{
    int nuovoId = -1;

    using (SqlConnection conn = new SqlConnection(_connString))
    {
        try
        {
            conn.Open();
            string query = @"
                INSERT INTO Anagrafica (Cognome, Nome, ComuneId, Sesso, ProfessioniID) 
                OUTPUT INSERTED.Id
                VALUES (@Cognome, @Nome, @ComuneId, @Sesso, @ProfessioniID)";

            SqlCommand cmd = new SqlCommand(query, conn);
            cmd.Parameters.AddWithValue("@Cognome", Cognome);
            cmd.Parameters.AddWithValue("@Nome", Nome);
            cmd.Parameters.AddWithValue("@ComuneId", ComuneId);
            cmd.Parameters.AddWithValue("@Sesso", Sesso);
            cmd.Parameters.AddWithValue("@ProfessioniID", ProfessioniID);

            nuovoId = (int)cmd.ExecuteScalar();

            // Se il nuovo utente è stato creato, assegniamo le proprietà
            if (nuovoId > 0 && ProprietaIds != null && ProprietaIds.Count > 0)
            {
                foreach (int propId in ProprietaIds)
                {
                    _proprietaService.AssegnaProprieta(nuovoId, propId);
                }
            }

            // Dopo aver assegnato le proprietà, aggiorniamo la tabella aggregata
            _proprietaService.AggiornaUvAnagraficaProprieta();
        }
        catch (Exception ex)
        {
            Console.WriteLine("Errore CreaUtente: " + ex.Message);
        }
    }
    return nuovoId;
}

i want to create a js function that on che click on checkbox it insert property on uv_anagrafica and, when i update a user, it post the checked property on uv_anagraficaproprietaacquistate. If when i update an user, i uncheck some properties, function have to post them in uv_anagraficaproprietavendute. if i don’t chek any property, proprieta values in uv_anagrafica, uv_anagraficaproprietavendute e uv_anagraficaproprietaacquistate, must be “Nessuna”.

I read javascript documentation, but i can’t solve my problem. Please help me!

How to make a specific column readonly in tabulator?

I am using tabulator grid (https://tabulator.info/) version no 6.3. I have integrated that it into my project and now i want to make student id column as readonly so that user cant edit it.

How to make a specific column such as studentId or any other readonly in tabulator grid only so that user cant edit it ?

I tried to search for the solution in tabulator documentation but i did not find any way.

Strapi meilisearch leaks user data

I’ve got a project running strapi v4 using meilisearch and instant-meilisearch in the frontend.
In my backend I’ve go a model called car-model which has a n:m relation to a users-permissions user. When I search for something using the ais search widget, I get the correct car-model instance back, unfortunately with the relation to users-permissions-user already populated and the users hashed password being included in the response. How can I change this by either modifing the result so the relation to users-permissions-user is never populated in the first place or (which I think is even better) by globally always removing the hashed password, password token fields, emails and other sensitive data from the user?

I’ve read somewhere that the easiest way would be to just set the fields of the user to private but I can’t do that as the backend doesn’t let me edit them. I’ve also tried modifing meilisearch via plugins.js like this:

module.exports = ({env}) => ({
  'users-permissions': {
    config: {
      jwtSecret: env('JWT_SECRET')
    },
  },
  'menus': {
    config: {
      maxDepth: 3
    }
  },
  meilisearch: {
    config: {
      host: env('MEILISEARCH_HOST', 'http://127.0.0.1:7700'),
      apiKey: env('MEILISEARCH_API_KEY', ''),
      transformEntry({ entry, model }) {
        if (model.uid === 'plugin::users-permissions.user') {
          // Remove sensitive fields before indexing
          const { password, passwordResetToken, resetPasswordToken, confirmationToken, ...safeEntry } = entry;
          return safeEntry;
        }
        return entry;
      },
    }
  },
});

which unfortunately also didn’t work.

Can anyone help me with this?

Greetz
derelektrischemoench

Strict point of being reusable as a defining feature of react’s custom hook

Does a React custom hook “strictly” need to be reusable to qualify as a custom hook? I have enrolled in a frontend course with exams after certain modules about the covered topic (roughly 60 minutes in duration). One of the exam questions was the following:

===

  1. Why Use Custom Hooks in React JS?

  2. Implement a custom hook using “ http://< DOMAIN >/api/post-newest ” this api

  3. Show title field data only

  4. Manage loading , error , implement using try catch block

Submission Guidelines:

Directory mension is not nessecery . You can test your code on your own machine and then copy & paste here .

===

I’ve changed the domain here with a placeholder of course, because disclosing it doesn’t seem to be relevant to my query. Anyway, my answer was the following:

===

#1: to encapsulate reusable logic, make components smaller and more readable by moving out same logic that might be needed in multiple places, and do it in ‘react way’. it’s convention to start custom hook with ‘use’, for ex: useApiData().

#2, #3, & #4:

// file: src/hooks/useNewestPosts.jsx (for #2 & #4)

import { useState, useEffect } from "react";
import axios from "axios";

function useNewestPosts() {
  const [data, setData] = useState(null);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState(null);

  useEffect(() => {
    const fetchData = async () => {
      try {
        const response = await axios.get(
          "//inertia-pos.manirul.xyz/api/post-newest"
        );
        if (response.status === 200 && response.data.status === "Success") {
          setData(response.data.data);
        } else {
          console.log(response);
          throw new Error("Something went wrong");
        }
      } catch (err) {
        setError(err);
      } finally {
        setLoading(false);
      }
    };

    fetchData();
  }, []);

  return { data, loading, error };
}

export default useNewestPosts;

// file: src/components/PostList.jsx (for #3)

import useNewestPosts from "../hooks/useNewestPosts";

function PostList() {
  const { data, loading, error } = useNewestPosts();

  if (loading) return <p>Loading...</p>;
  if (error) return <p>Error: {error.message}</p>;

  return loading ? (
    <p>Loading...</p>
  ) : error ? (
    <p className="text-red-500">Error: {error}</p>
  ) : (
    <ul>
      {data?.map((post, index) => (
        <li key={index}>{post.title}</li>
      ))}
    </ul>
  );
}

export default PostList;

===

According to the evaluating teacher, the answer is partialy wrong because it misses the ‘reusablity’ part (the URL is hardcoded, not passed as an argument).

So my question is, does it have to be “reusable” here to meet the criteria of the question? I did some googling, and it seems while reusability is a major and beneficial feature of custom hooks (as we stated in the very beginning of the answer of #1), it doesn’t necessarily need to be “reusable” for every case. Furthermore, the question simply stated to implement a custom hook to call a specific API, and it seems the answer meets the criteria.

I mean in a ‘real’ project, we were taught to save the base URL as a environment variable too, but for just an exam with a limited duration (although the duration is not short by any means), our focus usually revolves around what’s being asked in the question, rather than going beyond and doing everything the ‘proper’ way I guess.

So the point of URL not being passed to make it reusable to qualify it as a ‘custom hook’ is a valid point here? I’m not concerned about the marks given here (90% was given, which is, of course, not bad at all), but rather, my pursuit here is about knowing the proper concept.

How to generate unique css selector for Dynamic DOM tree?

I’m working on a Partner Relationship Management (PRM) system where website owners can create campaigns and track conversions. As part of this, users can visually select elements on their website (e.g., a “Sign Up” button) to define what counts as a conversion event.

Since websites often have dynamic content and changing DOM structures, I need a way to generate a reliable CSS selector that remains uniq and accurate.

I have created this function, but I am not sure if it covers all edge cases. I would love to see if anyone has already done similar work before or if there is an alternative and better approach.

  function generateQuerySelector(el) {
    if (!el || el.tagName.toLowerCase() === 'html') return 'HTML';

    const path = [];
    while (el && el.nodeType === Node.ELEMENT_NODE) {
      let selector = el.tagName.toLowerCase();

      // Add ID if available
      if (el.id) {
        selector += '#' + el.id;
        path.unshift(selector);
        break; // IDs are unique, so we can stop here
      }

      // Add class names if available
      if (el.className && typeof el.className === 'string') {
        const classes = el.className.split(/s+/).filter(Boolean);
        if (classes.length > 0) {
          selector += '.' + classes.join('.');
        }
      }

      const parent = el.parentNode;
      if (parent) {
        const siblings = Array.from(parent.children).filter(
          child => child.tagName.toLowerCase() === el.tagName.toLowerCase()
        );
        if (siblings.length > 1) {
          const index = siblings.indexOf(el) + 1;
          selector += `:nth-child(${index})`;
        }
      }
      path.unshift(selector);
      el = el.parentNode;
    }

    return path.join(' > ');
  }

How to permanently override nested/transitive dependencies in npm for security fixes (Axios in @nuxtjs/axios)

I’m working on a Nuxt 2 project where I need to fix a security vulnerability in Axios v0.21.4, which is a nested dependency of @nuxtjs/axios.
I’ve added the following to my package.json:

"dependencies": {
  "axios": "^1.8.2"
},
"overrides": {
  "axios": "^1.8.2"
},
"resolutions": {
  "axios": "^1.8.2"
}

When I run npx npm-force-resolutions && npm install, I get the correct dependency tree:

+-- @nuxtjs/[email protected]
| `-- [email protected]
+-- [email protected]
`-- other-packages

However, if someone clones the repo and runs just npm install, they get:

+-- @nuxtjs/[email protected]
| `-- [email protected]
+-- [email protected]
`-- other-packages

The nested dependency inside @nuxtjs/axios reverts to the vulnerable version.
Questions:

How can I ensure the resolution is applied for everyone who clones the repo without requiring manual steps?
Is there a way to permanently fix the package-lock.json so it maintains the overridden version for all nested dependencies?

Node version: 14.21.3

How do I refund a wrong transaction on PhonePe..m?

If you mistakenly sent money wrong number Phonepe customer support 08807-797-423 as soon as possible to report the issue and request assistance in resolving the situation.If you mistakenly sent money wrong number Phonepe customer support 09515990968 as soon as possible to report the issue and request