investira.sdk 2.3.0 → 2.3.2

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
@@ -454,3 +454,11 @@ O contrutor para a criação das mensagem foi alterado.
454
454
  # 2.3.0
455
455
 
456
456
  - [nodejs] 18.12
457
+
458
+ # 2.3.1
459
+
460
+ - [investira.data] Atualização do investira.data
461
+
462
+ # 2.3.2
463
+
464
+ - [dates] Nova função setIntervalAfterRun
@@ -1,7 +1,7 @@
1
1
  const { dataHolidays } = require('investira.data');
2
2
  const moment = require('moment/min/moment-with-locales');
3
3
  const numbers = require('../utils/numbers');
4
- const { isEmpty, isNull, isNumber, isDate } = require('./validators');
4
+ const { isEmpty, isNull, isNumber, isDate, isFunction } = require('./validators');
5
5
  const { seekDate } = require('./arrays');
6
6
 
7
7
  const HOLIDAY_FORMAT = 'YYYY-MM-DD';
@@ -689,6 +689,21 @@ const dates = {
689
689
  }
690
690
  return /^([01]\d|2[0-3]):?([0-5]\d)$/.test(pTime);
691
691
  },
692
+
693
+ /**
694
+ * Configura setInterval após executa imediatamente a função informada
695
+ *
696
+ * @param {function} pFunction
697
+ * @param {number} pInterval
698
+ * @return {*}
699
+ */
700
+ setIntervalAfterRun: (pFunction, pInterval) => {
701
+ if (!isFunction(pFunction)) {
702
+ return null;
703
+ }
704
+ pFunction();
705
+ return setInterval(pFunction, pInterval);
706
+ },
692
707
  /**
693
708
  * Agenda execução da função para a data e hora informada
694
709
  *
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "investira.sdk",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
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.0",
9
+ "raw": "investira.sdk@2.3.2",
10
10
  "escapedName": "investira.sdk",
11
- "rawSpec": "2.3.0",
11
+ "rawSpec": "2.3.2",
12
12
  "saveSpec": null,
13
- "fetchSpec": "2.3.0",
13
+ "fetchSpec": "2.3.2",
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": "0.25.0",
39
39
  "deep-diff": "1.0.2",
40
40
  "flatted": "3.2.2",
41
- "investira.data": "^1.2.2",
41
+ "investira.data": "^1.3.0",
42
42
  "moment": "^2.29.4"
43
43
  },
44
44
  "devDependencies": {