@depup/next-intl 4.14.3-depup.2 → 4.14.4-depup.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/README.md CHANGED
@@ -13,7 +13,7 @@ npm install @depup/next-intl
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [next-intl](https://www.npmjs.com/package/next-intl) @ 4.14.3 |
16
+ | Original | [next-intl](https://www.npmjs.com/package/next-intl) @ 4.14.4 |
17
17
  | Processed | 2026-09-11 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 4 |
package/changes.json CHANGED
@@ -17,6 +17,6 @@
17
17
  "to": "^1.1.0"
18
18
  }
19
19
  },
20
- "timestamp": "2026-09-11T08:13:05.751Z",
20
+ "timestamp": "2026-09-11T16:12:21.358Z",
21
21
  "totalUpdated": 4
22
22
  }
@@ -133,8 +133,14 @@ function getRoute(locale, pathname, pathnames) {
133
133
  function getBasePath(pathname, windowPathname = window.location.pathname) {
134
134
  if (pathname === '/') {
135
135
  return windowPathname;
136
+ } else if (windowPathname.endsWith(pathname)) {
137
+ // Only strip the trailing occurrence: the pathname can also
138
+ // appear inside the base path itself (e.g. `/dashboard/dash`)
139
+ return windowPathname.slice(0, -pathname.length);
136
140
  } else {
137
- return windowPathname.replace(pathname, '');
141
+ // Unexpected, since the window pathname should always end with
142
+ // the pathname. Assuming no base path is safe though.
143
+ return '';
138
144
  }
139
145
  }
140
146
  function applyPathnamePrefix(pathname, locale, routing, force) {
@@ -1 +1 @@
1
- import{getSortedPathnames as e,matchesPathname as n,isLocalizableHref as t,prefixPathname as r,normalizeTrailingSlash as o,getLocalizedTemplate as a,getLocalePrefix as i}from"../../shared/utils.js";function c(e){return"string"==typeof e?{pathname:e}:e}function s(e){function n(e){return String(e)}const t=new URLSearchParams;for(const[r,o]of Object.entries(e))Array.isArray(o)?o.forEach((e=>{t.append(r,n(e))})):t.set(r,n(o));return"?"+t.toString()}function f({pathname:e,locale:n,params:t,pathnames:r,query:i}){function c(e){const c=r[e];let f;if(c){const r=a(c,n,e);f=r,t&&Object.entries(t).forEach((([e,n])=>{let t,r;Array.isArray(n)?(t=`(\\[)?\\[...${e}\\](\\])?`,r=n.map((e=>String(e))).join("/")):(t=`\\[${e}\\]`,r=String(n)),f=f.replace(new RegExp(t,"g"),(()=>r))})),f=f.replace(/\[\[\.\.\..+\]\]/g,""),f=function(e){return new URL(e,"http://l").pathname}(f)}else f=e;return f=o(f),i&&(f+=s(i)),f}if("string"==typeof e)return c(e);{const{pathname:n,...t}=e;return{...t,pathname:c(n)}}}function l(t,r,o){const i=e(Object.keys(o)),c=decodeURI(r);for(const e of i){const r=o[e];if("string"==typeof r){if(n(r,c))return e}else if(n(a(r,t,e),c))return e}return r}function u(e,n=window.location.pathname){return"/"===e?n:n.replace(e,"")}function p(e,n,o,a){const{mode:c}=o.localePrefix;let s;if(void 0!==a)s=a;else if(t(e)){const e=o.domains?.find((e=>e.locales.includes(n))),t=e?.localePrefix||c;"always"===t?s=!0:"as-needed"===t&&(s=e?n!==e.defaultLocale:n!==o.defaultLocale)}return s?r(i(n,o.localePrefix),e):e}export{p as applyPathnamePrefix,f as compileLocalizedPathname,u as getBasePath,l as getRoute,c as normalizeNameOrNameWithParams,s as serializeSearchParams};
1
+ import{getSortedPathnames as e,matchesPathname as n,isLocalizableHref as t,prefixPathname as r,normalizeTrailingSlash as o,getLocalizedTemplate as a,getLocalePrefix as i}from"../../shared/utils.js";function c(e){return"string"==typeof e?{pathname:e}:e}function s(e){function n(e){return String(e)}const t=new URLSearchParams;for(const[r,o]of Object.entries(e))Array.isArray(o)?o.forEach((e=>{t.append(r,n(e))})):t.set(r,n(o));return"?"+t.toString()}function f({pathname:e,locale:n,params:t,pathnames:r,query:i}){function c(e){const c=r[e];let f;if(c){const r=a(c,n,e);f=r,t&&Object.entries(t).forEach((([e,n])=>{let t,r;Array.isArray(n)?(t=`(\\[)?\\[...${e}\\](\\])?`,r=n.map((e=>String(e))).join("/")):(t=`\\[${e}\\]`,r=String(n)),f=f.replace(new RegExp(t,"g"),(()=>r))})),f=f.replace(/\[\[\.\.\..+\]\]/g,""),f=function(e){return new URL(e,"http://l").pathname}(f)}else f=e;return f=o(f),i&&(f+=s(i)),f}if("string"==typeof e)return c(e);{const{pathname:n,...t}=e;return{...t,pathname:c(n)}}}function l(t,r,o){const i=e(Object.keys(o)),c=decodeURI(r);for(const e of i){const r=o[e];if("string"==typeof r){if(n(r,c))return e}else if(n(a(r,t,e),c))return e}return r}function u(e,n=window.location.pathname){return"/"===e?n:n.endsWith(e)?n.slice(0,-e.length):""}function p(e,n,o,a){const{mode:c}=o.localePrefix;let s;if(void 0!==a)s=a;else if(t(e)){const e=o.domains?.find((e=>e.locales.includes(n))),t=e?.localePrefix||c;"always"===t?s=!0:"as-needed"===t&&(s=e?n!==e.defaultLocale:n!==o.defaultLocale)}return s?r(i(n,o.localePrefix),e):e}export{p as applyPathnamePrefix,f as compileLocalizedPathname,u as getBasePath,l as getRoute,c as normalizeNameOrNameWithParams,s as serializeSearchParams};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/next-intl",
3
- "version": "4.14.3-depup.2",
3
+ "version": "4.14.4-depup.0",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -137,16 +137,16 @@
137
137
  "@formatjs/intl-localematcher": "^0.8.13",
138
138
  "@parcel/watcher": "^2.6.0",
139
139
  "@swc/core": "^1.16.2",
140
- "icu-minify": "^4.14.3",
140
+ "icu-minify": "^4.14.4",
141
141
  "negotiator": "^1.1.0",
142
- "next-intl-swc-plugin-extractor": "4.14.3",
143
- "use-intl": "^4.14.3"
142
+ "next-intl-swc-plugin-extractor": "4.14.4",
143
+ "use-intl": "^4.14.4"
144
144
  },
145
145
  "peerDependencies": {
146
146
  "next": "^12.0.0 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
147
147
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
148
148
  },
149
- "gitHead": "e9b1637796481a96b15dd081d5b92a5b1fa8ca02",
149
+ "gitHead": "8267c8f16d6c503abff7a3d909a89a0c6c862049",
150
150
  "depup": {
151
151
  "changes": {
152
152
  "@formatjs/intl-localematcher": {
@@ -168,8 +168,8 @@
168
168
  },
169
169
  "depsUpdated": 4,
170
170
  "originalPackage": "next-intl",
171
- "originalVersion": "4.14.3",
172
- "processedAt": "2026-09-11T08:13:20.793Z",
171
+ "originalVersion": "4.14.4",
172
+ "processedAt": "2026-09-11T16:12:35.191Z",
173
173
  "smokeTest": "passed"
174
174
  }
175
175
  }