Socket
Socket
Sign inDemoInstall

monaca-lib

Package Overview
Dependencies
218
Maintainers
8
Versions
134
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.8 to 4.1.9

5

CHANGELOG.md

@@ -5,2 +5,7 @@

v4.1.9
----
* Fix getting project name and description from config.xml
v4.1.8

@@ -7,0 +12,0 @@ ----

2

package.json
{
"name": "monaca-lib",
"version": "4.1.8",
"version": "4.1.9",
"description": "Monaca cloud and localkit API bindings for JavaScript",

@@ -5,0 +5,0 @@ "main": "./src/main.js",

@@ -131,2 +131,34 @@

// Function to retrieve the value of a specific widget from XML data
const getXmlWidgetValue = (xml, widgetName, defaultValue = '') => {
// Helper function to safely get the first value from an array
const safeGetFirstValue = (values) => {
if (!Array.isArray(values) || values.length === 0) {
return undefined;
}
const firstValue = values[0];
// If the first element is an object and has the '_' property, return its value
if (firstValue && typeof firstValue === 'object' && '_' in firstValue) {
return firstValue._;
}
return firstValue;
};
try {
// Check if xml.widget is an object and contains the specified widget name
if (xml.widget && typeof xml.widget === 'object' && widgetName in xml.widget) {
const value = xml.widget[widgetName];
const extractedValue = safeGetFirstValue(value);
return extractedValue !== undefined ? extractedValue : value;
}
} catch (error) {
console.error(`Error while getting widget value: ${error}`);
}
return typeof defaultValue === 'string' ? defaultValue : '';
};
module.exports = {

@@ -150,3 +182,4 @@ filterIgnoreFiles: filterIgnoreFiles,

startSpinner,
sleep
sleep,
getXmlWidgetValue,
};

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc