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

flexmonster-compressor

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flexmonster-compressor - npm Package Compare versions

Comparing version 2.7.6 to 2.7.7

test/data/json-data-5.json

2

package.json
{
"name": "flexmonster-compressor",
"version": "2.7.6",
"version": "2.7.7",
"description": "Flexmonster Compressor for Node.js – a special server-side compression tool that helps you to increase data loading speed from server to Flexmonster Pivot Table component.",

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

@@ -62,9 +62,10 @@ const version = require('../version');

composeDataRow(values) {
let result = [];
for (let colIdx = 0; colIdx < this._header.length; colIdx++) {
values[colIdx] = this.addMember(values[colIdx], colIdx);
result.push(this.addMember(values[colIdx], colIdx, values));
}
return values.join(",") + "\n";
return result.join(",") + "\n";
}
addMember(value, colIdx) {
addMember(value, colIdx, _values) {
let type = this._header[colIdx].type;

@@ -75,12 +76,11 @@ if (type == ColumnType.FACT) {

let _col = this._header[colIdx].parentHierarchy ? this._header[colIdx].parentHierarchy : this._header[colIdx];
let _lvlCaption = this._header[colIdx].caption;
let v = value ? value.toString() : "";
if (_col.members[_lvlCaption] == undefined) {
_col.members[_lvlCaption] = [];
if (type == ColumnType.LEVELS) {
v = this.getFullLevelMemberCaption(_values, colIdx);
}
if (_col.members[_lvlCaption][v.toLowerCase()] !== undefined) {
return "^" + _col.members[_lvlCaption][v.toLowerCase()];
if (_col.members[v.toLowerCase()] !== undefined) {
return "^" + _col.members[v.toLowerCase()];
} else {
_col.members[_lvlCaption][v.toLowerCase()] = _col.membersCount++;
return this.encodeChars(v);
_col.members[v.toLowerCase()] = _col.membersCount++;
return this.encodeChars(value ? value.toString() : "");
}

@@ -107,2 +107,13 @@ } else if (type == ColumnType.DATE ||

//composes full level's member name in reverse order, example: "Chicago.Illinois.Midwest"
getFullLevelMemberCaption(_values, colIdx) {
let memberNames = [];
while (this._header[colIdx].parentHierarchy) {
memberNames.push(_values[colIdx]);
colIdx--;
}
memberNames.push(_values[colIdx]);
return memberNames.join(".");
}
timeStrToSeconds(timeStr) {

@@ -202,3 +213,3 @@ var timeParts = timeStr.split(":");

constructor() {
this.members = [];
this.members = {};
this.membersCount = 0;

@@ -205,0 +216,0 @@ }

module.exports = {
VERSION: "2.7.6",
VERSION: "2.7.7",
VERSION_COMPATIBLE: "2.213"
}

@@ -464,2 +464,3 @@ const assert = require('assert');

'./test/data/json-data-4',
'./test/data/json-data-5',
];

@@ -466,0 +467,0 @@ files.forEach(filename => {

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