Skip to content

Commit

Permalink
fix(core): use toString method to convert IRI URL into a string
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovicm67 committed Sep 13, 2023
1 parent 9771a7b commit cb227a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-insects-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trifid-core": patch
---

Use toString method to convert IRI URL into a string
5 changes: 2 additions & 3 deletions packages/core/middlewares/iri.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import absoluteUrl from "absolute-url";
/**
* Replacement for `url.format` which is deprecated.
*
* @param {*} urlObject The URL object.
* @param {URL} urlObject The URL object.
* @returns {string} URL as a string.
*/
const urlFrom = (urlObject) =>
String(Object.assign(new URL("http://example.com"), urlObject));
const urlFrom = (urlObject) => urlObject.toString();

/**
* Remove the searchParams part of a URL.
Expand Down

0 comments on commit cb227a3

Please sign in to comment.