@i18n-micro/utils 1.0.4 → 1.0.7

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(t,i){if(!i||i==="/")return t;const r=i.endsWith("/")?i.slice(0,-1):i;return!r||r==="/"?t:t===r||t===`${r}/`?"/":t.startsWith(`${r}/`)?t.slice(r.length)||"/":t}exports.withoutAppBaseURL=e;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Strip Nuxt `app.baseURL` prefix from a request pathname.
3
+ * `getRequestURL(event).pathname` includes baseURL; Vue Router paths do not.
4
+ */
5
+ export declare function withoutAppBaseURL(pathname: string, baseURL?: string | null): string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Strip Nuxt `app.baseURL` prefix from a request pathname.
3
+ * `getRequestURL(event).pathname` includes baseURL; Vue Router paths do not.
4
+ */
5
+ export declare function withoutAppBaseURL(pathname: string, baseURL?: string | null): string;
@@ -0,0 +1,8 @@
1
+ function u(r, t) {
2
+ if (!t || t === "/") return r;
3
+ const i = t.endsWith("/") ? t.slice(0, -1) : t;
4
+ return !i || i === "/" ? r : r === i || r === `${i}/` ? "/" : r.startsWith(`${i}/`) ? r.slice(i.length) || "/" : r;
5
+ }
6
+ export {
7
+ u as withoutAppBaseURL
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-micro/utils",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "Framework-agnostic utilities for Nuxt I18n Micro (granular subpath imports).",
5
5
  "keywords": [
6
6
  "i18n",
@@ -330,6 +330,21 @@
330
330
  },
331
331
  "default": "./dist/build.mjs"
332
332
  },
333
+ "./app-path": {
334
+ "production": {
335
+ "types": "./dist/app-path.d.ts",
336
+ "default": "./dist/app-path.mjs"
337
+ },
338
+ "import": {
339
+ "types": "./dist/app-path.d.ts",
340
+ "default": "./dist/app-path.mjs"
341
+ },
342
+ "require": {
343
+ "types": "./dist/app-path.d.cts",
344
+ "default": "./dist/app-path.cjs"
345
+ },
346
+ "default": "./dist/app-path.mjs"
347
+ },
333
348
  "./package.json": "./package.json",
334
349
  "./dist/*": "./dist/*"
335
350
  },