address-rfc2822
Advanced tools
Comparing version 2.0.3 to 2.0.4
## 2.0.4 - 2018-06-29 | ||
- throw a proper error object, not a string. | ||
## 2.0.3 - 2018-03-01 | ||
@@ -3,0 +7,0 @@ |
@@ -6,3 +6,3 @@ 'use strict'; | ||
exports.parse = function parse (line, startAt) { | ||
if (!line) throw 'Nothing to parse'; | ||
if (!line) throw new Error('Nothing to parse'); | ||
@@ -21,3 +21,3 @@ line = line.trim(); | ||
if (!addr) throw 'No results'; | ||
if (!addr) throw new Error('No results'); | ||
@@ -24,0 +24,0 @@ // console.log("Parsed to: ", require('util').inspect(addr, {depth: 10, colors: true})); |
{ | ||
"name": "address-rfc2822", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "RFC 2822 (Header) email address parser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,2 +59,14 @@ const address = require('../index'); | ||
test.done(); | ||
}, | ||
'root (Cron Daemon)': function (test) { | ||
test.expect(1); | ||
try { | ||
const r = address.parseFrom('root (Cron Daemon)'); | ||
test.equal(r[0].address, ''); | ||
// console.log(r); | ||
} | ||
catch (e) { | ||
test.equal(e.message, 'No results'); | ||
} | ||
test.done(); | ||
} | ||
@@ -61,0 +73,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
48667
624
0