docs: function pack(href, API_URL) {
    var parts = url.parse(href);
    var pn = API_URL.pathname || '/';
    if (parts.host !== API_URL.host || parts.pathname.indexOf(pn) !== 0) return href;
    if (pn === '/') pn = '';
    return parts.pathname.replace(pn, '~') + (parts.search || '');
  }