Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contrail/documents

Package Overview
Dependencies
Maintainers
0
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrail/documents - npm Package Compare versions

Comparing version 1.0.101 to 1.0.102

19

lib/util/dynamic-text/dynamic-text-util.js

@@ -19,10 +19,13 @@ "use strict";

static getTextFromFrameMemberValues(displayFunction, property, memberValues) {
let text = '';
if (memberValues.length === 0) {
return text;
}
const formatter = new types_1.PropertyValueFormatter();
let text = '';
if (displayFunction === DynamicTextDisplayFunction.AVERAGE) {
memberValues = memberValues.filter((e) => e !== null && e !== undefined && !isNaN(e));
memberValues = memberValues.filter(e => e !== null && e !== undefined && !isNaN(e));
text = formatter.formatValueForProperty(memberValues.reduce((a, b) => a + b, 0) / memberValues.length, property);
}
else if (displayFunction === DynamicTextDisplayFunction.SUM) {
memberValues = memberValues.filter((e) => e !== null && e !== undefined && !isNaN(e));
memberValues = memberValues.filter(e => e !== null && e !== undefined && !isNaN(e));
text = formatter.formatValueForProperty(memberValues.reduce((a, b) => a + b, 0), property);

@@ -32,5 +35,5 @@ }

text = Array.from(new Set(memberValues
.filter((e) => e !== null && e !== undefined)
.filter(e => e !== null && e !== undefined)
.flat()
.map((e) => formatter.formatValueForProperty(e, property))))
.map(e => formatter.formatValueForProperty(e, property))))
.sort()

@@ -44,10 +47,10 @@ .join(', ');

else if (displayFunction === DynamicTextDisplayFunction.LAST) {
text = formatter.formatValueForProperty([memberValues.length - 1], property);
text = formatter.formatValueForProperty(memberValues[memberValues.length - 1], property);
}
else if (displayFunction === DynamicTextDisplayFunction.MIN) {
memberValues = memberValues.filter((e) => e !== null && e !== undefined);
memberValues = memberValues.filter(e => e !== null && e !== undefined);
text = formatter.formatValueForProperty(Math.min(...memberValues), property);
}
else if (displayFunction === DynamicTextDisplayFunction.MAX) {
memberValues = memberValues.filter((e) => e !== null && e !== undefined);
memberValues = memberValues.filter(e => e !== null && e !== undefined);
text = formatter.formatValueForProperty(Math.max(...memberValues), property);

@@ -54,0 +57,0 @@ }

{
"name": "@contrail/documents",
"version": "1.0.101",
"version": "1.0.102",
"description": "Documents library for contrail platform",

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

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