How to use the fast-url-parser.format function in fast-url-parser

To help you get started, we’ve selected a few fast-url-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algolia / marvel-search / lib / utils / helper-marvel.js View on Github external
getUrl(data) {
    let url = _.find(_.get(data, 'urls'), {type: 'detail'}).url;

    // Urls targeting /comics/characters are not interesting at all
    if (url.match(/comics\/characters/)) {
      return null;
    }

    let parsedUrl = URL.parse(url, true);
    parsedUrl.search = null;
    parsedUrl.query = null;
    return URL.format(parsedUrl);
  }
};

fast-url-parser

Extremely fast implementation of node core url library

MIT
Latest version published 9 years ago

Package Health Score

67 / 100
Full package analysis