rittenhop-dev/versions/5.94.2/node_modules/@tryghost/social-urls/lib/index.js

18 lines
495 B
JavaScript
Raw Normal View History

2024-09-23 19:40:12 -04:00
/**
* @param {string} username
* @returns {string}
*/
module.exports.twitter = function twitter(username) {
// Creates the canonical twitter URL without the '@'
return 'https://twitter.com/' + username.replace(/^@/, '');
};
/**
* @param {string} username
* @returns {string}
*/
module.exports.facebook = function facebook(username) {
// Handles a starting slash, this shouldn't happen, but just in case
return 'https://www.facebook.com/' + username.replace(/^\//, '');
};