Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: unjs/ufo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.5.1
Choose a base ref
...
head repository: unjs/ufo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.5.2
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Mar 15, 2024

  1. chore(release): v1.5.1

    pi0 committed Mar 15, 2024
    Copy the full SHA
    2dd616e View commit details

Commits on Mar 18, 2024

  1. fix: use lookbehind regex only inside joinRelativeURL (#226)

    pi0 authored Mar 18, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9d481ff View commit details
  2. chore(deps): update all non-major dependencies (#223)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Mar 18, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5621692 View commit details
Showing with 80 additions and 58 deletions.
  1. +17 −0 CHANGELOG.md
  2. +5 −5 package.json
  3. +55 −52 pnpm-lock.yaml
  4. +3 −1 src/utils.ts
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,23 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## v1.5.1

[compare changes](https://github.com/unjs/ufo/compare/v1.5.0...v1.5.1)

### 🩹 Fixes

- **joinRelativeURL:** Handle base with protocol ([#222](https://github.com/unjs/ufo/pull/222))

### 🏡 Chore

- Update readme ([ffc9d3e](https://github.com/unjs/ufo/commit/ffc9d3e))
- Add automd to autofix ci ([fffbcd4](https://github.com/unjs/ufo/commit/fffbcd4))

### ❤️ Contributors

- Pooya Parsa ([@pi0](http://github.com/pi0))

## v1.5.0

[compare changes](https://github.com/unjs/ufo/compare/v1.4.0...v1.5.0)
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ufo",
"version": "1.5.0",
"version": "1.5.1",
"description": "URL utils for humans",
"repository": "unjs/ufo",
"license": "MIT",
@@ -30,8 +30,8 @@
"test": "pnpm lint && vitest run --typecheck"
},
"devDependencies": {
"@types/node": "^20.11.25",
"@vitest/coverage-v8": "^1.3.1",
"@types/node": "^20.11.28",
"@vitest/coverage-v8": "^1.4.0",
"automd": "^0.3.6",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
@@ -41,7 +41,7 @@
"typescript": "^5.4.2",
"unbuild": "^2.0.0",
"untyped": "^1.4.2",
"vitest": "^1.3.1"
"vitest": "^1.4.0"
},
"packageManager": "pnpm@8.15.4"
"packageManager": "pnpm@8.15.5"
}
107 changes: 55 additions & 52 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ const PROTOCOL_RELATIVE_REGEX = /^([/\\]\s*){2,}[^/\\]/;
const PROTOCOL_SCRIPT_RE = /^[\s\0]*(blob|data|javascript|vbscript):$/i;
const TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
const JOIN_LEADING_SLASH_RE = /^\.?\//;
const JOIN_SEGMENT_SPLIT_RE = /(?<!\/)\/(?!\/)/;

/**
* Check if a path starts with `./` or `../`.
@@ -346,6 +345,9 @@ export function joinURL(base: string, ...input: string[]): string {
* @group utils
*/
export function joinRelativeURL(..._input: string[]): string {
// Inlined regex to increase browser compatibiltiy for lookbehind (#224)
const JOIN_SEGMENT_SPLIT_RE = /(?<!\/)\/(?!\/)/;

const input = _input.filter(Boolean);

const segments: string[] = [];