c2-clinical 1.0.123 → 1.0.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,6 @@
1
1
  import { IFormUnit, IRow } from "../../../models/form/FormUnit";
2
2
  declare class ConvertRowToFormUnitsFlowItem {
3
- private formUnits;
4
3
  execute(rows: IRow[]): IFormUnit[];
5
- private iterate;
6
4
  }
7
5
  declare const _default: ConvertRowToFormUnitsFlowItem;
8
6
  export default _default;
@@ -1,23 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class ConvertRowToFormUnitsFlowItem {
4
- formUnits = [];
5
4
  execute(rows) {
6
- for (const row of rows) {
7
- this.formUnits = [...this.formUnits, ...this.iterate(row)];
5
+ function iterate(row) {
6
+ let formUnits = [];
7
+ row.collumns?.forEach((collumn) => {
8
+ formUnits.push({ ...collumn, lineId: row.id });
9
+ if (collumn.lines?.length) {
10
+ collumn.lines.forEach((line) => {
11
+ formUnits = [...formUnits, ...iterate(line)];
12
+ });
13
+ }
14
+ });
15
+ return formUnits;
8
16
  }
9
- return this.formUnits;
10
- }
11
- iterate(row) {
12
17
  let formUnits = [];
13
- row.collumns?.forEach((collumn) => {
14
- formUnits.push({ ...collumn, lineId: row.id });
15
- if (collumn.lines?.length) {
16
- collumn.lines.forEach((line) => {
17
- formUnits = [...formUnits, ...this.iterate(line)];
18
- });
19
- }
20
- });
18
+ for (const row of rows) {
19
+ formUnits = [...formUnits, ...iterate(row)];
20
+ }
21
21
  return formUnits;
22
22
  }
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-clinical",
3
- "version": "1.0.123",
3
+ "version": "1.0.124",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://github.com/cabralsilva/c2-clinical.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",