medialize / medialize/URI.js

No way to detect root and document-relative urls

Open
#340 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
6.2k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Hi!

Thanks for great library!

let uri = new URI("/example/");
uri.is("relative");

tells whether uri is relative or not. However, there is no way to distinguish those two urls:

let rootRelative = new URI("/example/");
let documentRelative = new URI("example/");

Both will be relative, while sometimes it is neccessary to determinate exactly which type of relative urls it is: root-relative or document-relative.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the URI.is("relative") entry point shown in the issue and inspect how it classifies paths beginning with "/" versus those without it. Define completion as exposing a way to distinguish root-relative "/example/" from document-relative "example/", while preserving the existing relative classification.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.