@dhyasama/totem-models 6.26.1 → 6.26.2
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/lib/Organization.js +4 -4
- package/lib/Person.js +3 -3
- package/package.json +1 -1
- package/test/Organization.js +2 -2
- package/test/Person.js +2 -2
package/lib/Organization.js
CHANGED
|
@@ -1430,10 +1430,10 @@ module.exports = function(mongoose, config) {
|
|
|
1430
1430
|
self
|
|
1431
1431
|
.find({ $or:
|
|
1432
1432
|
[
|
|
1433
|
-
{ 'social.facebook': new RegExp('facebook.com/' + username + '
|
|
1434
|
-
{ 'social.linkedin': new RegExp('linkedin.com/company/' + username + '
|
|
1435
|
-
{ 'social.twitter': new RegExp('twitter.com/' + username + '
|
|
1436
|
-
{ 'crunchbase.url': new RegExp('crunchbase.com/organization/' + username + '
|
|
1433
|
+
{ 'social.facebook': new RegExp('facebook.com/' + username + '\/?$', 'i') },
|
|
1434
|
+
{ 'social.linkedin': new RegExp('linkedin.com/company/' + username + '\/?$', 'i') },
|
|
1435
|
+
{ 'social.twitter': new RegExp('twitter.com/' + username + '\/?$', 'i') },
|
|
1436
|
+
{ 'crunchbase.url': new RegExp('crunchbase.com/organization/' + username + '\/?$', 'i') }
|
|
1437
1437
|
],
|
|
1438
1438
|
'deleted': { $ne: true }
|
|
1439
1439
|
})
|
package/lib/Person.js
CHANGED
|
@@ -721,9 +721,9 @@ module.exports = function(mongoose, config) {
|
|
|
721
721
|
self
|
|
722
722
|
.find({ $or:
|
|
723
723
|
[
|
|
724
|
-
{ 'social.facebook': new RegExp('facebook.com/' + username + '
|
|
725
|
-
{ 'social.linkedin': new RegExp('linkedin.com/in/' + username + '
|
|
726
|
-
{ 'social.twitter': new RegExp('twitter.com/' + username + '
|
|
724
|
+
{ 'social.facebook': new RegExp('facebook.com/' + username + '$/?', 'i') },
|
|
725
|
+
{ 'social.linkedin': new RegExp('linkedin.com/in/' + username + '\/?$', 'i') },
|
|
726
|
+
{ 'social.twitter': new RegExp('twitter.com/' + username + '/?$', 'i') }
|
|
727
727
|
],
|
|
728
728
|
'deleted': { $ne: true }
|
|
729
729
|
})
|
package/package.json
CHANGED
package/test/Organization.js
CHANGED
|
@@ -76,8 +76,8 @@ describe('Organization', function() {
|
|
|
76
76
|
org2.crunchbase.uuid = 'abc';
|
|
77
77
|
org2.crunchbase.url = 'abc';
|
|
78
78
|
org2.social.facebook = 'https://facebook.com/abc';
|
|
79
|
-
org2.social.linkedin = 'http://www.linkedin.com/in/abc';
|
|
80
|
-
org2.social.twitter = 'twitter.com/abc';
|
|
79
|
+
org2.social.linkedin = 'http://www.linkedin.com/in/abc/';
|
|
80
|
+
org2.social.twitter = 'twitter.com/abc/';
|
|
81
81
|
org2.iLevel.push({
|
|
82
82
|
customer: new mongoose.Types.ObjectId(),
|
|
83
83
|
url: 'https://ilevel.com/test'
|
package/test/Person.js
CHANGED
|
@@ -141,7 +141,7 @@ describe('Person', function() {
|
|
|
141
141
|
person3.aliases.push('Slippery Pete');
|
|
142
142
|
person3.social = {
|
|
143
143
|
facebook: 'facebook.com/slipperypete',
|
|
144
|
-
linkedin: 'http://www.linkedin.com/in/slipperypete',
|
|
144
|
+
linkedin: 'http://www.linkedin.com/in/slipperypete/',
|
|
145
145
|
twitter: 'https://twitter.com/slipperypete'
|
|
146
146
|
};
|
|
147
147
|
person3.contact.email.push({
|
|
@@ -750,7 +750,7 @@ describe('Person', function() {
|
|
|
750
750
|
});
|
|
751
751
|
|
|
752
752
|
it('finds person by linkedin with http and no www', function (done) {
|
|
753
|
-
Person.findBySocial('http://linkedin.com/in/slipperypete', function (err, result) {
|
|
753
|
+
Person.findBySocial('http://linkedin.com/in/slipperypete?hello=world', function (err, result) {
|
|
754
754
|
should.not.exist(err);
|
|
755
755
|
should.exist(result);
|
|
756
756
|
result.length.should.equal(1);
|