investira.sdk 2.3.16 → 2.3.18

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.
package/CHANGELOG.md CHANGED
@@ -521,3 +521,11 @@ O contrutor para a criação das mensagem foi alterado.
521
521
  # 2.3.16
522
522
 
523
523
  - [objetcs] Alteração da getDiff
524
+
525
+ # 2.3.17
526
+
527
+ - [objetcs] Alteração da getDiff
528
+
529
+ # 2.3.18
530
+
531
+ - [objetcs] Correção da mergeObject
@@ -229,7 +229,7 @@ const httpRequests = {
229
229
  /**
230
230
  * Retorna ip original do request
231
231
  *
232
- * @param {*} req
232
+ * @param {*} pAddress
233
233
  * @returns
234
234
  */
235
235
  getAddress: pAddress => {
@@ -253,9 +253,11 @@ const httpRequests = {
253
253
  * @param {string} [pUrl='https://investira.com.br'] Ação a se executa se não houver conexão
254
254
  * @return {Promise}
255
255
  */
256
- hasConnection: async (pUrl = 'https://investira.com.br') => {
256
+ hasConnection: async (pUrl = 'https://investira.com.br', pTimeout = null) => {
257
257
  const xProps = { url: pUrl, rejectUnauthorized: false };
258
-
258
+ if (pTimeout) {
259
+ xProps.timeout = pTimeout;
260
+ }
259
261
  let xResult = false;
260
262
 
261
263
  await httpRequests
@@ -316,6 +316,7 @@ const objects = {
316
316
  },
317
317
 
318
318
  mergeObject: (pTarget, pSource, pOptionsArgument) => {
319
+ let xTarget = pTarget || {};
319
320
  let xDestination = {};
320
321
  if (isMergeable(pTarget)) {
321
322
  Object.keys(pTarget).forEach(xKey => {
@@ -323,10 +324,10 @@ const objects = {
323
324
  });
324
325
  }
325
326
  Object.keys(pSource).forEach(xKey => {
326
- if (!isMergeable(pSource[xKey]) || !pTarget[xKey]) {
327
+ if (!isMergeable(pSource[xKey]) || !xTarget[xKey]) {
327
328
  xDestination[xKey] = objects.cloneIfNecessary(pSource[xKey], pOptionsArgument);
328
329
  } else {
329
- xDestination[xKey] = objects.deepMerge(pTarget[xKey], pSource[xKey], pOptionsArgument);
330
+ xDestination[xKey] = objects.deepMerge(xTarget[xKey], pSource[xKey], pOptionsArgument);
330
331
  }
331
332
  });
332
333
  return xDestination;
@@ -343,9 +344,10 @@ const objects = {
343
344
  let xCurrentData = objects.deepCopy(pCurrentData);
344
345
  let xNewData = objects.deepCopy(pNewData);
345
346
  if (isFunction(pOnMerge)) {
347
+ //Exclui dados nulos do registro atual
346
348
  xCurrentData = objects.deleteNull(xCurrentData);
349
+ //Incorpora os dados novos dentro do registro atual
347
350
  xNewData = objects.deepMerge(xCurrentData, xNewData);
348
- xCurrentData = objects.deepMerge(xNewData, xCurrentData);
349
351
  pOnMerge(xNewData);
350
352
  }
351
353
  return diff(xCurrentData, xNewData, {
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "investira.sdk",
3
- "version": "2.3.16",
3
+ "version": "2.3.18",
4
4
  "author": "Investira",
5
5
  "description": "Investira SDK",
6
6
  "main": "index.js",
7
7
  "type": "commonjs",
8
8
  "registry": true,
9
- "raw": "investira.sdk@2.3.16",
9
+ "raw": "investira.sdk@2.3.18",
10
10
  "escapedName": "investira.sdk",
11
- "rawSpec": "2.3.16",
11
+ "rawSpec": "2.3.18",
12
12
  "saveSpec": null,
13
- "fetchSpec": "2.3.16",
13
+ "fetchSpec": "2.3.18",
14
14
  "homepage": "https://investira.com.br/",
15
15
  "engines": {
16
16
  "node": ">=11.11.0 <=18.12",
@@ -38,7 +38,7 @@
38
38
  "axios": "1.5.1",
39
39
  "deep-diff": "1.0.2",
40
40
  "flatted": "3.2.9",
41
- "investira.data": "^1.3.4",
41
+ "investira.data": "^1.3.6",
42
42
  "moment": "^2.30.1"
43
43
  },
44
44
  "devDependencies": {