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

skydiet-lib-node

Package Overview
Dependencies
Maintainers
0
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skydiet-lib-node - npm Package Compare versions

Comparing version 1.0.33 to 1.0.34

16

dist/index.js

@@ -83,12 +83,12 @@ "use strict";

let formulaToEnable = item.formulaToEnable;
formulaToEnable = (0, exports.buildFormula)(questionsAnswereds, formulaToEnable);
//TENTAR EXECUTAR A FORMULA
let enable = false;
enable = (0, exports.execFormula)(false, formulaToEnable);
if (!enable) {
items.splice(index, 1);
if (formulaToEnable) {
formulaToEnable = (0, exports.buildFormula)(questionsAnswereds, formulaToEnable);
//TENTAR EXECUTAR A FORMULA
let enable = false;
enable = (0, exports.execFormula)(false, formulaToEnable);
if (!enable) {
items.splice(index, 1);
}
}
});
// const result = generateIdentifiers(items, fieldsToGroup);
// console.log(result)
const groupeds2 = items.reduce((acc, currentValue, currentIndex, array) => {

@@ -95,0 +95,0 @@ let itemAux = {};

{
"name": "skydiet-lib-node",
"version": "1.0.33",
"version": "1.0.34",
"description": "Biblioteca para funções skydiet",

@@ -5,0 +5,0 @@ "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",

@@ -60,35 +60,35 @@ /* eslint-disable @typescript-eslint/no-unused-vars */

array.forEach(item => {
// Gera combinações dinâmicas para os campos
const combinations = fields.map(field => {
if (Array.isArray(item[field])) {
return item[field] ?? "";
} else if (item[field] !== undefined) {
return [item[field]];
}
return [];
array.forEach(item => {
// Gera combinações dinâmicas para os campos
const combinations = fields.map(field => {
if (Array.isArray(item[field])) {
return item[field] ?? "";
} else if (item[field] !== undefined) {
return [item[field]];
}
return [];
});
// Combina todas as variações entre os campos
const allCombinations = combinations.reduce((acc, values, index) => {
if (acc.length === 0) return values.map((value: any) => ({ [fields[index]]: value }));
const newCombinations: any[] = [];
acc.forEach((accCombination: any) => {
values.forEach((value: any) => {
newCombinations.push({ ...accCombination, [fields[acc.length]]: value });
});
});
return newCombinations;
}, []);
// Combina todas as variações entre os campos
const allCombinations = combinations.reduce((acc, values, index) => {
if (acc.length === 0) return values.map((value: any) => ({ [fields[index]]: value }));
const newCombinations: any[] = [];
acc.forEach((accCombination: any) => {
values.forEach((value: any) => {
newCombinations.push({ ...accCombination, [fields[acc.length]]: value });
});
});
return newCombinations;
}, []);
// Adiciona ao Map somente combinações únicas com o ID gerado
allCombinations.forEach((combination: any) => {
const id = fields.map(field => combination[field]).join("_");
if (!result.has(id)) {
result.set(id, { id, ...combination });
}
});
// Adiciona ao Map somente combinações únicas com o ID gerado
allCombinations.forEach((combination: any) => {
const id = fields.map(field => combination[field]).join("_");
if (!result.has(id)) {
result.set(id, { id, ...combination });
}
});
});
return Array.from(result.values()); // Converte o Map em um array de objetos
return Array.from(result.values()); // Converte o Map em um array de objetos

@@ -106,20 +106,18 @@ }

items.forEach((item: any, index: number) => {
items.forEach((item: any, index: number) => {
//MONTAGEM DA FORMULA COM OS VALORES
let formulaToEnable: string = item.formulaToEnable
//MONTAGEM DA FORMULA COM OS VALORES
let formulaToEnable: string = item.formulaToEnable
if (formulaToEnable) {
formulaToEnable = buildFormula(questionsAnswereds, formulaToEnable)
//TENTAR EXECUTAR A FORMULA
let enable: boolean = false
enable = execFormula(false, formulaToEnable)
if (!enable) {
items.splice(index, 1)
}
})
}
})
// const result = generateIdentifiers(items, fieldsToGroup);
// console.log(result)
const groupeds2 = items.reduce((acc: any, currentValue: any, currentIndex: number, array: any[]) => {

@@ -142,10 +140,10 @@ let itemAux = {} as { [key: string]: any, id: any, items: any[] }

for (const chave of chavesOfItem) {
const existingGrouped = acc.find((i: any) => i.id === chave.id)
if (!existingGrouped) {
// itemAux.id = chave
itemAux = { ...itemAux, ...chave}
itemAux = { ...itemAux, ...chave }
itemAux.items = []

@@ -152,0 +150,0 @@ itemAux.items.push(currentValue)

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