// should this be configuration?
var orcidRe = /(\d{4}-\d{4}-\d{4}-\d{4})@orcid\.org/;
var Url = require('url');

module.exports = {

  emailFromORCID: function (orcid) {
    return orcid + '@orcid.org';
  },

  ORCIDFromEmail: function (email) {
    var m = orcidRe.exec(email);
    if (m !== null) {
      return m[1];
    }
  },

  modEntry: function (entry, orcid) {
    entry.orcid = orcid;
    // delete entry.email; -- not removing key -- badgekit constraint?
    entry.email = undefined;
    return true;
  },

  urlFromDOI: function (doi) {
    return 'http://dx.doi.org/' + doi;
  },

  DOIFromURL: function (url) {
    // pathname should be '/10.1371/journal.pbio.1002126' from 'http://dx.doi.org/10.1371/journal.pbio.1002126'
    return encodeURI(Url.parse(url).pathname) || url;
  }

};

@@ -397,18 +397,8 @@
     
-// delete 
 entr
@@ -408,82 +408,91 @@
 mail
-; -- not removing key -- badgekit constraint?%0A    entry.email = undefined;
+ = undefined; // set undefined to remove value from badgekit%0A    delete entry.email
 %0A   

delete email key for tests