function mobilify(url, origin) {
  if (url) {
    return url.replace(/https?:\/\/(?:np\.)?(?:www\.)?reddit.com/g, origin || '');
  }

  return url;
}

export default mobilify;

function mobilify(url, origin) {
  if (url) {
    return url.replace(/https?:\/\/(?:np\.)?(?:www\.)?reddit\.com\//g, `${origin || ''}/`);
  }

  return url;
}

export default mobilify;

Fix a small bug in the mobilify helper function
Fix a small bug in the mobilify helper function
