emailjs-addressparser
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -152,5 +152,9 @@ 'use strict'; | ||
// Keep only the first address occurence, push others to regular text | ||
// Keep only the last address occurence, push others to regular text | ||
if (data.address.length > 1) { | ||
data.text = data.text.concat(data.address.splice(1)); | ||
var _address = data.address.pop(); | ||
data.text = data.text.concat(data.address.map(function (fakeAddress) { | ||
return '<' + fakeAddress + '>'; | ||
})); | ||
data.address = [_address]; | ||
} | ||
@@ -306,2 +310,2 @@ | ||
}(); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9hZGRyZXNzcGFyc2VyLmpzIl0sIm5hbWVzIjpbInBhcnNlIiwic3RyIiwidG9rZW5pemVyIiwiVG9rZW5pemVyIiwidG9rZW5zIiwidG9rZW5pemUiLCJhZGRyZXNzZXMiLCJhZGRyZXNzIiwicGFyc2VkQWRkcmVzc2VzIiwiZm9yRWFjaCIsInRva2VuIiwidHlwZSIsInZhbHVlIiwibGVuZ3RoIiwicHVzaCIsIl9oYW5kbGVBZGRyZXNzIiwiY29uY2F0IiwiaXNHcm91cCIsInN0YXRlIiwiZGF0YSIsImNvbW1lbnQiLCJncm91cCIsInRleHQiLCJpIiwibGVuIiwiam9pbiIsIm5hbWUiLCJtYXRjaCIsInNwbGljZSIsIl9yZWdleEhhbmRsZXIiLCJ0cmltIiwicmVwbGFjZSIsIk9QRVJBVE9SUyIsInRvU3RyaW5nIiwib3BlcmF0b3JDdXJyZW50Iiwib3BlcmF0b3JFeHBlY3RpbmciLCJub2RlIiwiZXNjYXBlZCIsImxpc3QiLCJjaHIiLCJjaGFyQXQiLCJjaGVja0NoYXIiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O2tCQWN3QkEsSzs7OztBQWR4Qjs7Ozs7Ozs7Ozs7Ozs7QUFjZSxTQUFTQSxLQUFULENBQWdCQyxHQUFoQixFQUFxQjtBQUNsQyxNQUFNQyxZQ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NhcGVkID0gZmFsc2VcbiAgICAgIHJldHVyblxuICAgIH1cblxuICAgIGlmICghdGhpcy5lc2NhcGVkICYmIGNociA9PT0gJ1xcXFwnKSB7XG4gICAgICB0aGlzLmVzY2FwZWQgPSB0cnVlXG4gICAgICByZXR1cm5cbiAgICB9XG5cbiAgICBpZiAoIXRoaXMubm9kZSkge1xuICAgICAgdGhpcy5ub2RlID0ge1xuICAgICAgICB0eXBlOiAndGV4dCcsXG4gICAgICAgIHZhbHVlOiAnJ1xuICAgICAgfVxuICAgICAgdGhpcy5saXN0LnB1c2godGhpcy5ub2RlKVxuICAgIH1cblxuICAgIGlmICh0aGlzLmVzY2FwZWQgJiYgY2hyICE9PSAnXFxcXCcpIHtcbiAgICAgIHRoaXMubm9kZS52YWx1ZSArPSAnXFxcXCdcbiAgICB9XG5cbiAgICB0aGlzLm5vZGUudmFsdWUgKz0gY2hyXG4gICAgdGhpcy5lc2NhcGVkID0gZmFsc2VcbiAgfVxufVxuIl19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9hZGRyZXNzcGFyc2VyLmpzIl0sIm5hbWVzIjpbInBhcnNlIiwic3RyIiwidG9rZW5pemVyIiwiVG9rZW5pemVyIiwidG9rZW5zIiwidG9rZW5pemUiLCJhZGRyZXNzZXMiLCJhZGRyZXNzIiwicGFyc2VkQWRkcmVzc2VzIiwiZm9yRWFjaCIsInRva2VuIiwidHlwZSIsInZhbHVlIiwibGVuZ3RoIiwicHVzaCIsIl9oYW5kbGVBZGRyZXNzIiwiY29uY2F0IiwiaXNHcm91cCIsInN0YXRlIiwiZGF0YSIsImNvbW1lbnQiLCJncm91cCIsInRleHQiLCJpIiwibGVuIiwiam9pbiIsIm5hbWUiLCJtYXRjaCIsInNwbGljZSIsIl9yZWdleEhhbmRsZXIiLCJ0cmltIiwicmVwbGFjZSIsInBvcCIsIm1hcCIsImZha2VBZGRyZXNzIiwiT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dGhpcy5lc2NhcGVkID0gZmFsc2VcbiAgfVxufVxuIl19 |
{ | ||
"name": "emailjs-addressparser", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"homepage": "https://github.com/emailjs/emailjs-addressparser", | ||
@@ -17,4 +17,4 @@ "description": "Parse rfc2822 address fields", | ||
"build": "./scripts/build.sh", | ||
"release": "./scripts/release.sh", | ||
"lint": "$(npm bin)/standard", | ||
"preversion": "npm run build", | ||
"test": "npm run lint && npm run unit", | ||
@@ -33,7 +33,7 @@ "unit": "$(npm bin)/mocha './src/*-unit.js' --reporter spec --require babel-register testutils.js", | ||
"babel-register": "^6.26.0", | ||
"chai": "^4.1.2", | ||
"mocha": "^4.0.1", | ||
"nodemon": "^1.12.1", | ||
"chai": "^4.2.0", | ||
"mocha": "^6.1.4", | ||
"nodemon": "^1.19.1", | ||
"pre-commit": "^1.2.2", | ||
"standard": "^10.0.3" | ||
"standard": "^12.0.1" | ||
}, | ||
@@ -40,0 +40,0 @@ "standard": { |
@@ -192,2 +192,35 @@ import parse from './addressparser' | ||
}) | ||
it('should handle phishing address with name looking like an address', () => { | ||
const input = '<phising@address.com> <real@address.com>' | ||
const expected = [{ | ||
address: 'real@address.com', | ||
name: '<phising@address.com>' | ||
}] | ||
expect(parse(input)).to.deep.equal(expected) | ||
}) | ||
it('should handle phishing address and multiple addresses 1', () => { | ||
const input = 'me@example.com, <phising@address.com> <real@address.com>' | ||
const expected = [{ | ||
address: 'me@example.com', | ||
name: '' | ||
}, { | ||
address: 'real@address.com', | ||
name: '<phising@address.com>' | ||
}] | ||
expect(parse(input)).to.deep.equal(expected) | ||
}) | ||
it('should handle phishing address and multiple addresses 2', () => { | ||
const input = '<phising@address.com> <real@address.com>, me@example.com' | ||
const expected = [{ | ||
address: 'real@address.com', | ||
name: '<phising@address.com>' | ||
}, { | ||
address: 'me@example.com', | ||
name: '' | ||
}] | ||
expect(parse(input)).to.deep.equal(expected) | ||
}) | ||
}) |
@@ -141,5 +141,7 @@ /** | ||
// Keep only the first address occurence, push others to regular text | ||
// Keep only the last address occurence, push others to regular text | ||
if (data.address.length > 1) { | ||
data.text = data.text.concat(data.address.splice(1)) | ||
const address = data.address.pop() | ||
data.text = data.text.concat(data.address.map(fakeAddress => `<${fakeAddress}>`)) | ||
data.address = [address] | ||
} | ||
@@ -146,0 +148,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45262
755
12
1