@wordpress/url 4.42.0 → 4.43.1-next.v.202604091042.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.43.0 (2026-04-01)
6
+
5
7
  ## 4.42.0 (2026-03-18)
6
8
 
7
9
  ## 4.41.0 (2026-03-04)
@@ -30,7 +30,7 @@ function getFilename(url) {
30
30
  }
31
31
  try {
32
32
  filename = new URL(url, "http://example.com").pathname.split("/").pop();
33
- } catch (error) {
33
+ } catch {
34
34
  }
35
35
  if (filename) {
36
36
  return filename;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/get-filename.ts"],
4
- "sourcesContent": ["/**\n * Returns the filename part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'\n * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'\n * ```\n *\n * @return The filename part of the URL.\n */\nexport function getFilename( url: string ): string | void {\n\tlet filename;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfilename = new URL( url, 'http://example.com' ).pathname\n\t\t\t.split( '/' )\n\t\t\t.pop();\n\t} catch ( error ) {}\n\n\tif ( filename ) {\n\t\treturn filename;\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,YAAa,KAA6B;AACzD,MAAI;AAEJ,MAAK,CAAE,KAAM;AACZ;AAAA,EACD;AAEA,MAAI;AACH,eAAW,IAAI,IAAK,KAAK,oBAAqB,EAAE,SAC9C,MAAO,GAAI,EACX,IAAI;AAAA,EACP,SAAU,OAAQ;AAAA,EAAC;AAEnB,MAAK,UAAW;AACf,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Returns the filename part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'\n * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'\n * ```\n *\n * @return The filename part of the URL.\n */\nexport function getFilename( url: string ): string | void {\n\tlet filename;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfilename = new URL( url, 'http://example.com' ).pathname\n\t\t\t.split( '/' )\n\t\t\t.pop();\n\t} catch {}\n\n\tif ( filename ) {\n\t\treturn filename;\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,YAAa,KAA6B;AACzD,MAAI;AAEJ,MAAK,CAAE,KAAM;AACZ;AAAA,EACD;AAEA,MAAI;AACH,eAAW,IAAI,IAAK,KAAK,oBAAqB,EAAE,SAC9C,MAAO,GAAI,EACX,IAAI;AAAA,EACP,QAAQ;AAAA,EAAC;AAET,MAAK,UAAW;AACf,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -27,7 +27,7 @@ function getQueryString(url) {
27
27
  let query;
28
28
  try {
29
29
  query = new URL(url, "http://example.com").search.substring(1);
30
- } catch (error) {
30
+ } catch {
31
31
  }
32
32
  if (query) {
33
33
  return query;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/get-query-string.ts"],
4
- "sourcesContent": ["/**\n * Returns the query string part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'\n * ```\n *\n * @return The query string part of the URL.\n */\nexport function getQueryString( url: string ): string | void {\n\tlet query;\n\ttry {\n\t\tquery = new URL( url, 'http://example.com' ).search.substring( 1 );\n\t} catch ( error ) {}\n\n\tif ( query ) {\n\t\treturn query;\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,SAAS,eAAgB,KAA6B;AAC5D,MAAI;AACJ,MAAI;AACH,YAAQ,IAAI,IAAK,KAAK,oBAAqB,EAAE,OAAO,UAAW,CAAE;AAAA,EAClE,SAAU,OAAQ;AAAA,EAAC;AAEnB,MAAK,OAAQ;AACZ,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Returns the query string part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'\n * ```\n *\n * @return The query string part of the URL.\n */\nexport function getQueryString( url: string ): string | void {\n\tlet query;\n\ttry {\n\t\tquery = new URL( url, 'http://example.com' ).search.substring( 1 );\n\t} catch {}\n\n\tif ( query ) {\n\t\treturn query;\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,SAAS,eAAgB,KAA6B;AAC5D,MAAI;AACJ,MAAI;AACH,YAAQ,IAAI,IAAK,KAAK,oBAAqB,EAAE,OAAO,UAAW,CAAE;AAAA,EAClE,QAAQ;AAAA,EAAC;AAET,MAAK,OAAQ;AACZ,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(safe_decode_uri_component_exports);
26
26
  function safeDecodeURIComponent(uriComponent) {
27
27
  try {
28
28
  return decodeURIComponent(uriComponent);
29
- } catch (uriComponentError) {
29
+ } catch {
30
30
  return uriComponent;
31
31
  }
32
32
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/safe-decode-uri-component.ts"],
4
- "sourcesContent": ["/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param uriComponent URI component to decode.\n *\n * @return Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent: string ): string {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch ( uriComponentError ) {\n\t\treturn uriComponent;\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,uBAAwB,cAA+B;AACtE,MAAI;AACH,WAAO,mBAAoB,YAAa;AAAA,EACzC,SAAU,mBAAoB;AAC7B,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param uriComponent URI component to decode.\n *\n * @return Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent: string ): string {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch {\n\t\treturn uriComponent;\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,uBAAwB,cAA+B;AACtE,MAAI;AACH,WAAO,mBAAoB,YAAa;AAAA,EACzC,QAAQ;AACP,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(safe_decode_uri_exports);
26
26
  function safeDecodeURI(uri) {
27
27
  try {
28
28
  return decodeURI(uri);
29
- } catch (uriError) {
29
+ } catch {
30
30
  return uri;
31
31
  }
32
32
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/safe-decode-uri.ts"],
4
- "sourcesContent": ["/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return Decoded URI if possible.\n */\nexport function safeDecodeURI( uri: string ): string {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch ( uriError ) {\n\t\treturn uri;\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,cAAe,KAAsB;AACpD,MAAI;AACH,WAAO,UAAW,GAAI;AAAA,EACvB,SAAU,UAAW;AACpB,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return Decoded URI if possible.\n */\nexport function safeDecodeURI( uri: string ): string {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch {\n\t\treturn uri;\n\t}\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaO,SAAS,cAAe,KAAsB;AACpD,MAAI;AACH,WAAO,UAAW,GAAI;AAAA,EACvB,QAAQ;AACP,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -6,7 +6,7 @@ function getFilename(url) {
6
6
  }
7
7
  try {
8
8
  filename = new URL(url, "http://example.com").pathname.split("/").pop();
9
- } catch (error) {
9
+ } catch {
10
10
  }
11
11
  if (filename) {
12
12
  return filename;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/get-filename.ts"],
4
- "sourcesContent": ["/**\n * Returns the filename part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'\n * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'\n * ```\n *\n * @return The filename part of the URL.\n */\nexport function getFilename( url: string ): string | void {\n\tlet filename;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfilename = new URL( url, 'http://example.com' ).pathname\n\t\t\t.split( '/' )\n\t\t\t.pop();\n\t} catch ( error ) {}\n\n\tif ( filename ) {\n\t\treturn filename;\n\t}\n}\n"],
5
- "mappings": ";AAaO,SAAS,YAAa,KAA6B;AACzD,MAAI;AAEJ,MAAK,CAAE,KAAM;AACZ;AAAA,EACD;AAEA,MAAI;AACH,eAAW,IAAI,IAAK,KAAK,oBAAqB,EAAE,SAC9C,MAAO,GAAI,EACX,IAAI;AAAA,EACP,SAAU,OAAQ;AAAA,EAAC;AAEnB,MAAK,UAAW;AACf,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Returns the filename part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const filename1 = getFilename( 'http://localhost:8080/this/is/a/test.jpg' ); // 'test.jpg'\n * const filename2 = getFilename( '/this/is/a/test.png' ); // 'test.png'\n * ```\n *\n * @return The filename part of the URL.\n */\nexport function getFilename( url: string ): string | void {\n\tlet filename;\n\n\tif ( ! url ) {\n\t\treturn;\n\t}\n\n\ttry {\n\t\tfilename = new URL( url, 'http://example.com' ).pathname\n\t\t\t.split( '/' )\n\t\t\t.pop();\n\t} catch {}\n\n\tif ( filename ) {\n\t\treturn filename;\n\t}\n}\n"],
5
+ "mappings": ";AAaO,SAAS,YAAa,KAA6B;AACzD,MAAI;AAEJ,MAAK,CAAE,KAAM;AACZ;AAAA,EACD;AAEA,MAAI;AACH,eAAW,IAAI,IAAK,KAAK,oBAAqB,EAAE,SAC9C,MAAO,GAAI,EACX,IAAI;AAAA,EACP,QAAQ;AAAA,EAAC;AAET,MAAK,UAAW;AACf,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -3,7 +3,7 @@ function getQueryString(url) {
3
3
  let query;
4
4
  try {
5
5
  query = new URL(url, "http://example.com").search.substring(1);
6
- } catch (error) {
6
+ } catch {
7
7
  }
8
8
  if (query) {
9
9
  return query;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/get-query-string.ts"],
4
- "sourcesContent": ["/**\n * Returns the query string part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'\n * ```\n *\n * @return The query string part of the URL.\n */\nexport function getQueryString( url: string ): string | void {\n\tlet query;\n\ttry {\n\t\tquery = new URL( url, 'http://example.com' ).search.substring( 1 );\n\t} catch ( error ) {}\n\n\tif ( query ) {\n\t\treturn query;\n\t}\n}\n"],
5
- "mappings": ";AAYO,SAAS,eAAgB,KAA6B;AAC5D,MAAI;AACJ,MAAI;AACH,YAAQ,IAAI,IAAK,KAAK,oBAAqB,EAAE,OAAO,UAAW,CAAE;AAAA,EAClE,SAAU,OAAQ;AAAA,EAAC;AAEnB,MAAK,OAAQ;AACZ,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Returns the query string part of the URL.\n *\n * @param url The full URL.\n *\n * @example\n * ```js\n * const queryString = getQueryString( 'http://localhost:8080/this/is/a/test?query=true#fragment' ); // 'query=true'\n * ```\n *\n * @return The query string part of the URL.\n */\nexport function getQueryString( url: string ): string | void {\n\tlet query;\n\ttry {\n\t\tquery = new URL( url, 'http://example.com' ).search.substring( 1 );\n\t} catch {}\n\n\tif ( query ) {\n\t\treturn query;\n\t}\n}\n"],
5
+ "mappings": ";AAYO,SAAS,eAAgB,KAA6B;AAC5D,MAAI;AACJ,MAAI;AACH,YAAQ,IAAI,IAAK,KAAK,oBAAqB,EAAE,OAAO,UAAW,CAAE;AAAA,EAClE,QAAQ;AAAA,EAAC;AAET,MAAK,OAAQ;AACZ,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -2,7 +2,7 @@
2
2
  function safeDecodeURIComponent(uriComponent) {
3
3
  try {
4
4
  return decodeURIComponent(uriComponent);
5
- } catch (uriComponentError) {
5
+ } catch {
6
6
  return uriComponent;
7
7
  }
8
8
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/safe-decode-uri-component.ts"],
4
- "sourcesContent": ["/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param uriComponent URI component to decode.\n *\n * @return Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent: string ): string {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch ( uriComponentError ) {\n\t\treturn uriComponent;\n\t}\n}\n"],
5
- "mappings": ";AAQO,SAAS,uBAAwB,cAA+B;AACtE,MAAI;AACH,WAAO,mBAAoB,YAAa;AAAA,EACzC,SAAU,mBAAoB;AAC7B,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Safely decodes a URI component with `decodeURIComponent`. Returns the URI component unmodified if\n * `decodeURIComponent` throws an error.\n *\n * @param uriComponent URI component to decode.\n *\n * @return Decoded URI component if possible.\n */\nexport function safeDecodeURIComponent( uriComponent: string ): string {\n\ttry {\n\t\treturn decodeURIComponent( uriComponent );\n\t} catch {\n\t\treturn uriComponent;\n\t}\n}\n"],
5
+ "mappings": ";AAQO,SAAS,uBAAwB,cAA+B;AACtE,MAAI;AACH,WAAO,mBAAoB,YAAa;AAAA,EACzC,QAAQ;AACP,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
@@ -2,7 +2,7 @@
2
2
  function safeDecodeURI(uri) {
3
3
  try {
4
4
  return decodeURI(uri);
5
- } catch (uriError) {
5
+ } catch {
6
6
  return uri;
7
7
  }
8
8
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/safe-decode-uri.ts"],
4
- "sourcesContent": ["/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return Decoded URI if possible.\n */\nexport function safeDecodeURI( uri: string ): string {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch ( uriError ) {\n\t\treturn uri;\n\t}\n}\n"],
5
- "mappings": ";AAaO,SAAS,cAAe,KAAsB;AACpD,MAAI;AACH,WAAO,UAAW,GAAI;AAAA,EACvB,SAAU,UAAW;AACpB,WAAO;AAAA,EACR;AACD;",
4
+ "sourcesContent": ["/**\n * Safely decodes a URI with `decodeURI`. Returns the URI unmodified if\n * `decodeURI` throws an error.\n *\n * @param uri URI to decode.\n *\n * @example\n * ```js\n * const badUri = safeDecodeURI( '%z' ); // does not throw an Error, simply returns '%z'\n * ```\n *\n * @return Decoded URI if possible.\n */\nexport function safeDecodeURI( uri: string ): string {\n\ttry {\n\t\treturn decodeURI( uri );\n\t} catch {\n\t\treturn uri;\n\t}\n}\n"],
5
+ "mappings": ";AAaO,SAAS,cAAe,KAAsB;AACpD,MAAI;AACH,WAAO,UAAW,GAAI;AAAA,EACvB,QAAQ;AACP,WAAO;AAAA,EACR;AACD;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/url",
3
- "version": "4.42.0",
3
+ "version": "4.43.1-next.v.202604091042.0+668146787",
4
4
  "description": "WordPress URL utilities.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -49,5 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "c20787b1778ae64c2db65643b1c236309d68e6ba"
52
+ "gitHead": "73606df74f1c38a084bfa5db97205259ef817593"
53
53
  }
@@ -22,7 +22,7 @@ export function getFilename( url: string ): string | void {
22
22
  filename = new URL( url, 'http://example.com' ).pathname
23
23
  .split( '/' )
24
24
  .pop();
25
- } catch ( error ) {}
25
+ } catch {}
26
26
 
27
27
  if ( filename ) {
28
28
  return filename;
@@ -14,7 +14,7 @@ export function getQueryString( url: string ): string | void {
14
14
  let query;
15
15
  try {
16
16
  query = new URL( url, 'http://example.com' ).search.substring( 1 );
17
- } catch ( error ) {}
17
+ } catch {}
18
18
 
19
19
  if ( query ) {
20
20
  return query;
@@ -9,7 +9,7 @@
9
9
  export function safeDecodeURIComponent( uriComponent: string ): string {
10
10
  try {
11
11
  return decodeURIComponent( uriComponent );
12
- } catch ( uriComponentError ) {
12
+ } catch {
13
13
  return uriComponent;
14
14
  }
15
15
  }
@@ -14,7 +14,7 @@
14
14
  export function safeDecodeURI( uri: string ): string {
15
15
  try {
16
16
  return decodeURI( uri );
17
- } catch ( uriError ) {
17
+ } catch {
18
18
  return uri;
19
19
  }
20
20
  }