@nachocab/pipedream-global 2.0.40 → 2.0.43

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/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  require('./src/util');
2
2
  const { getFormattedStudents } = require('./src/get_formatted_students');
3
3
 
4
+ const moment = require('moment');
5
+
4
6
  const {
5
7
  nestedArrayToArrayOfObjects,
6
8
  objectOfArraysToNestedArray,
@@ -19,6 +21,7 @@ const { getMatchesFromNonMatches } = require('./src/get_matches_from_non_matches
19
21
 
20
22
  // REMEMBER TO ADD HERE AND ALSO IN THE ABOVE REQUIRES!!!
21
23
  module.exports = {
24
+ moment,
22
25
  getFormattedStudents,
23
26
  getMeetingType,
24
27
  nestedArrayToArrayOfObjects,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nachocab/pipedream-global",
3
- "version": "2.0.40",
3
+ "version": "2.0.43",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "lodash": "^4.17.19",
16
- "moment": "^2.27.0"
16
+ "moment": "^2.30.1"
17
17
  },
18
18
  "devDependencies": {
19
19
  "chai": "^4.2.0",
@@ -68,7 +68,7 @@ function parseClassEmail(emailBody) {
68
68
 
69
69
  const scheduledFor = moment(
70
70
  `${day} ${hour}`,
71
- ['D/M/YYYY H:mm', 'D-M-YYYY H:mm'],
71
+ ['D/M/YYYY H:mm', 'D-M-YYYY H:mm', 'DD-MM-YYYY H:mm'],
72
72
  'es',
73
73
  true
74
74
  ).format('YYYY-MM-DDTHH:mm');
@@ -1,5 +1,4 @@
1
1
  const expect = require('chai').expect;
2
-
3
2
  const { parseClassEmail } = require('../src/parse_class_email');
4
3
 
5
4
  describe('parseClassEmail', function () {
@@ -36,6 +35,17 @@ describe('parseClassEmail', function () {
36
35
  expect(() => parseClassEmail(emailBody)).to.throw('Invalid day');
37
36
  });
38
37
 
38
+ it('allows DD format', function () {
39
+ const emailBody = `
40
+ @nombre: @gloria
41
+ Nivel: Intermedio
42
+ Día: 01-01-2025
43
+ hora: 16:00
44
+ Zona: America/Mexico_City
45
+ `;
46
+ expect(parseClassEmail(emailBody)[0].scheduledFor).to.eql('2025-01-01T16:00');
47
+ });
48
+
39
49
  it('allows one-digit day', function () {
40
50
  const emailBody = `
41
51
  @nombre: @gloría