@tryghost/social-urls 0.1.51 → 0.1.53

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.
Files changed (2) hide show
  1. package/lib/index.js +6 -2
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -80,6 +80,10 @@ module.exports.instagram = function instagram(username) {
80
80
  * @returns {string}
81
81
  */
82
82
  module.exports.linkedin = function linkedin(username) {
83
- // LinkedIn URLs use /in/, stored without @
84
- return 'https://www.linkedin.com/in/' + username;
83
+ // LinkedIn URLs use in/, company/, school/, or pub/ stored as-is
84
+ const pathTypes = ['in/', 'company/', 'school/', 'pub/'];
85
+ // If username doesn't start with one of those, default to in/
86
+ const endOfUrl = pathTypes.some(pathType => username.startsWith(pathType)) ? username : 'in/' + username;
87
+
88
+ return 'https://www.linkedin.com/' + endOfUrl;
85
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/social-urls",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/TryGhost/SDK.git",
@@ -27,5 +27,5 @@
27
27
  "should": "13.2.3",
28
28
  "sinon": "21.0.0"
29
29
  },
30
- "gitHead": "b10773947244536b8829fec0540819990c901987"
30
+ "gitHead": "8d4cf3dfddc7c9fd6c499e672be94e64123b23bd"
31
31
  }