@tryghost/social-urls 0.1.37 → 0.1.39

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/README.md CHANGED
@@ -11,6 +11,14 @@ or
11
11
 
12
12
  ## Usage
13
13
 
14
+ ```js
15
+ const {twitter: makeTwitter, facebook: makeFacebook} = require('@tryghost/social-urls');
16
+
17
+ const socialUrls = [
18
+ makeTwitter('@ghost'), // https://twitter.com/ghost
19
+ makeFacebook('/ghost') // https://facebook.com/ghost
20
+ ];
21
+ ```
14
22
 
15
23
  ## Develop
16
24
 
package/lib/index.js CHANGED
@@ -1,8 +1,16 @@
1
+ /**
2
+ * @param {string} username
3
+ * @returns {string}
4
+ */
1
5
  module.exports.twitter = function twitter(username) {
2
6
  // Creates the canonical twitter URL without the '@'
3
7
  return 'https://twitter.com/' + username.replace(/^@/, '');
4
8
  };
5
9
 
10
+ /**
11
+ * @param {string} username
12
+ * @returns {string}
13
+ */
6
14
  module.exports.facebook = function facebook(username) {
7
15
  // Handles a starting slash, this shouldn't happen, but just in case
8
16
  return 'https://www.facebook.com/' + username.replace(/^\//, '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/social-urls",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "repository": "https://github.com/TryGhost/SDK/tree/master/packages/social-urls",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "c8": "7.13.0",
22
22
  "mocha": "10.2.0",
23
23
  "should": "13.2.3",
24
- "sinon": "15.0.3"
24
+ "sinon": "15.0.4"
25
25
  },
26
- "gitHead": "cf56126d88e83961e52e001031cc8c3f43fd050a"
26
+ "gitHead": "60ab3c7b73d1d7d92987b7eb3d8e73f920dd6800"
27
27
  }