@nachocab/pipedream-global 2.0.39 → 2.0.42

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.39",
3
+ "version": "2.0.42",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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 () {
@@ -435,6 +434,29 @@ En la sesión del día 30 de noviembre seguiremos con nuestra clase de`,
435
434
  ]);
436
435
  });
437
436
 
437
+ it('ignores URGENT markers', function () {
438
+ const emailBody = `
439
+ @nombre: @nacho Nivel: Avanzado Día: 1-11-2020 hora: 17:30 Zona: Europe/Madrid Título: Traducciones a la vista Agenda: Buscaremos los equivalentes más naturales === URGENT @nombre: @nacho Nivel: Avanzado Día: 8-11-2020 hora: 18:30 Zona: Europe/Madrid Título: Traducciones a la vista 2 Agenda: Buscaremos los equivalentes más naturales ===`;
440
+ expect(parseClassEmail(emailBody)).to.eql([
441
+ {
442
+ teacherUsername: 'nacho',
443
+ classLevelName: 'avanzado',
444
+ scheduledFor: '2020-11-01T17:30',
445
+ timeZone: 'Europe/Madrid',
446
+ classTitle: 'Traducciones a la vista',
447
+ classDescription: 'Buscaremos los equivalentes más naturales',
448
+ },
449
+ {
450
+ teacherUsername: 'nacho',
451
+ classLevelName: 'avanzado',
452
+ scheduledFor: '2020-11-08T18:30',
453
+ timeZone: 'Europe/Madrid',
454
+ classTitle: 'Traducciones a la vista 2',
455
+ classDescription: 'Buscaremos los equivalentes más naturales',
456
+ },
457
+ ]);
458
+ });
459
+
438
460
  it('handles English', function () {
439
461
  const emailBody = `@username: @Kevin
440
462
  Day: 21-10-2021
@@ -449,7 +471,7 @@ En la sesión del día 30 de noviembre seguiremos con nuestra clase de`,
449
471
  scheduledFor: '2021-10-21T18:30',
450
472
  timeZone: 'America/Chicago',
451
473
  classTitle: 'Vocab',
452
- classDescription: `Blah blah\n`,
474
+ classDescription: 'Blah blah\n',
453
475
  },
454
476
  ]);
455
477
  });
@@ -9,6 +9,11 @@ const {
9
9
 
10
10
  describe('reshape', function () {
11
11
  describe('nestedArrayToArrayOfObjects', function () {
12
+ it('works when empty', function () {
13
+ const objectOfArrays = nestedArrayToArrayOfObjects([]);
14
+ expect(objectOfArrays).to.eql([]);
15
+ });
16
+
12
17
  // default google sheets values
13
18
  it('works', function () {
14
19
  const objectOfArrays = nestedArrayToArrayOfObjects([