Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

@jridgewell/resolve-uri

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Issues
File Explorer

Advanced tools

@jridgewell/resolve-uri

Resolve a URI relative to an optional base URI

    3.1.0latest

Version published
Maintainers
1
Weekly downloads
21,761,454
decreased by-12.26%

Weekly downloads

Changelog

Source

v3.1.0

What's Changed

  • Implement query and hash resolution by @jridgewell in https://github.com/jridgewell/resolve-uri/pull/114

Full Changelog: https://github.com/jridgewell/resolve-uri/compare/v3.0.8...v3.1.0

Readme

Source

@jridgewell/resolve-uri

Resolve a URI relative to an optional base URI

Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths.

Installation

npm install @jridgewell/resolve-uri

Usage

function resolve(input: string, base?: string): string; import resolve from '@jridgewell/resolve-uri'; resolve('foo', 'https://example.com'); // => 'https://example.com/foo'
InputBaseResolutionExplanation
https://example.comanyhttps://example.com/Input is normalized only
//example.comhttps://base.com/https://example.com/Input inherits the base's protocol
//example.comrest//example.com/Input is normalized only
/examplehttps://base.com/https://base.com/exampleInput inherits the base's origin
/example//base.com///base.com/exampleInput inherits the base's host and remains protocol relative
/examplerest/exampleInput is normalized only
examplehttps://base.com/dir/https://base.com/dir/exampleInput is joined with the base
examplehttps://base.com/filehttps://base.com/exampleInput is joined with the base without its file
example//base.com/dir///base.com/dir/exampleInput is joined with the base's last directory
example//base.com/file//base.com/exampleInput is joined with the base without its file
example/base/dir//base/dir/exampleInput is joined with the base's last directory
example/base/file/base/exampleInput is joined with the base without its file
examplebase/dir/base/dir/exampleInput is joined with the base's last directory
examplebase/filebase/exampleInput is joined with the base without its file

Keywords

FAQs

What is @jridgewell/resolve-uri?

Resolve a URI relative to an optional base URI

Is @jridgewell/resolve-uri popular?

The npm package @jridgewell/resolve-uri receives a total of 17,438,166 weekly downloads. As such, @jridgewell/resolve-uri popularity was classified as popular.

Is @jridgewell/resolve-uri well maintained?

We found that @jridgewell/resolve-uri demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 05 Jul 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc