import { WebSocialShareWithTextAttributes } from '../types/web-social-share-attributes' ; import { shareEncodedUrl , staticOpenNewWindow } from './utils' ; export const hackernews = async ( attrs ) => { let urlString = 'https://news.ycombinator.com/submitlink?u=' ; urlString += shareEncodedUrl ( attrs . socialShareUrl ) ; if ( attrs . socialShareText ) { urlString += '&t=' + encodeURIComponent ( attrs . socialShareText ) ; } staticOpenNewWindow ( urlString ) ; } ;