adamgibbons / ics

iCalendar (ics) file generator for node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unicode emails not passing validation check

sharpstorm opened this issue · comments

Bug Description

Bumping yup to 1.2.0 in #243 causes the creation of events with unicode emails to fail unexpectedly. This is due to a regex change in yup which no longer accepts unicode characters in email addresses.

Code to Reproduce

This is a slight modification of the example code to include an attendee with a unicode email.

ics.createEvent({
  start: [2018, 5, 30, 6, 30],
  duration: { hours: 6, minutes: 30 },
  title: 'Bolder Boulder',
  description: 'Annual 10-kilometer run in Boulder, Colorado',
  location: 'Folsom Field, University of Colorado (finish line)',
  url: 'http://www.bolderboulder.com/',
  geo: { lat: 40.0095, lon: 105.2669 },
  categories: ['10k races', 'Memorial Day Weekend', 'Boulder CO'],
  status: 'CONFIRMED',
  busyStatus: 'BUSY',
  organizer: { name: 'Admin', email: 'Race@BolderBOULDER.com' },
  attendees: [
    { name: 'Adam Gibbons', email: 'àdam@example.com', rsvp: true, partstat: 'ACCEPTED', role: 'REQ-PARTICIPANT' },
  ]
})