@8ms/helpers 3.1.0 → 3.1.1

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.
@@ -5,9 +5,11 @@ const require_react_client_hooks_useCopyText = require("./hooks/useCopyText.cjs"
5
5
  const require_react_client_hooks_usePrefersReducedMotion = require("./hooks/usePrefersReducedMotion.cjs");
6
6
  const require_react_client_nextAuth_isSessionReady = require("./nextAuth/isSessionReady.cjs");
7
7
  const require_react_client_nextAuth_nextAuth = require("./nextAuth/nextAuth.cjs");
8
+ const require_react_client_nextjs_buildRelativeUrl = require("./nextjs/buildRelativeUrl.cjs");
8
9
  const require_LazyLoad = require("./LazyLoad.cjs");
9
10
  exports.LazyLoad = require_LazyLoad.LazyLoad;
10
11
  exports.NextAuthState = require_react_client_nextAuth_nextAuth.NextAuthState;
12
+ exports.buildRelativeUrl = require_react_client_nextjs_buildRelativeUrl.buildRelativeUrl;
11
13
  exports.cn = require_react_client_cn.cn;
12
14
  exports.isSessionReady = require_react_client_nextAuth_isSessionReady.isSessionReady;
13
15
  exports.useAsyncEffect = require_react_client_hooks_useAsyncEffect.useAsyncEffect;
@@ -4,5 +4,6 @@ import { useCopyText } from "./hooks/useCopyText.cjs";
4
4
  import { usePrefersReducedMotion } from "./hooks/usePrefersReducedMotion.cjs";
5
5
  import { isSessionReady } from "./nextAuth/isSessionReady.cjs";
6
6
  import { NextAuthState } from "./nextAuth/nextAuth.cjs";
7
+ import { buildRelativeUrl } from "./nextjs/buildRelativeUrl.cjs";
7
8
  import { LazyLoad } from "./LazyLoad.cjs";
8
- export { LazyLoad, NextAuthState, cn, isSessionReady, useAsyncEffect, useCopyText, usePrefersReducedMotion };
9
+ export { LazyLoad, NextAuthState, buildRelativeUrl, cn, isSessionReady, useAsyncEffect, useCopyText, usePrefersReducedMotion };
@@ -4,5 +4,6 @@ import { useCopyText } from "./hooks/useCopyText.mjs";
4
4
  import { usePrefersReducedMotion } from "./hooks/usePrefersReducedMotion.mjs";
5
5
  import { isSessionReady } from "./nextAuth/isSessionReady.mjs";
6
6
  import { NextAuthState } from "./nextAuth/nextAuth.mjs";
7
+ import { buildRelativeUrl } from "./nextjs/buildRelativeUrl.mjs";
7
8
  import { LazyLoad } from "./LazyLoad.mjs";
8
- export { LazyLoad, NextAuthState, cn, isSessionReady, useAsyncEffect, useCopyText, usePrefersReducedMotion };
9
+ export { LazyLoad, NextAuthState, buildRelativeUrl, cn, isSessionReady, useAsyncEffect, useCopyText, usePrefersReducedMotion };
@@ -4,5 +4,6 @@ import { useCopyText } from "./hooks/useCopyText.mjs";
4
4
  import { usePrefersReducedMotion } from "./hooks/usePrefersReducedMotion.mjs";
5
5
  import { isSessionReady } from "./nextAuth/isSessionReady.mjs";
6
6
  import { NextAuthState } from "./nextAuth/nextAuth.mjs";
7
+ import { buildRelativeUrl } from "./nextjs/buildRelativeUrl.mjs";
7
8
  import { LazyLoad } from "./LazyLoad.mjs";
8
- export { LazyLoad, NextAuthState, cn, isSessionReady, useAsyncEffect, useCopyText, usePrefersReducedMotion };
9
+ export { LazyLoad, NextAuthState, buildRelativeUrl, cn, isSessionReady, useAsyncEffect, useCopyText, usePrefersReducedMotion };
@@ -0,0 +1,14 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_url_buildUrl = require("../../../url/buildUrl.cjs");
3
+ //#region src/react/client/nextjs/buildRelativeUrl.ts
4
+ /**
5
+ * Create a new relative URL based on the current path.
6
+ */
7
+ const buildRelativeUrl = (router, updated = {}) => {
8
+ return require_url_buildUrl.buildUrl(router.pathname, {
9
+ ...router.query,
10
+ ...updated
11
+ });
12
+ };
13
+ //#endregion
14
+ exports.buildRelativeUrl = buildRelativeUrl;
@@ -1 +1,7 @@
1
- export {}
1
+ import { NextRouter } from "next/router";
2
+ //#region src/react/client/nextjs/buildRelativeUrl.d.ts
3
+ /**
4
+ * Create a new relative URL based on the current path.
5
+ */
6
+ export declare const buildRelativeUrl: (router: NextRouter, updated?: Record<string, unknown>) => string;
7
+ //#endregion
@@ -1 +1,7 @@
1
- export {}
1
+ import { NextRouter } from "next/router";
2
+ //#region src/react/client/nextjs/buildRelativeUrl.d.ts
3
+ /**
4
+ * Create a new relative URL based on the current path.
5
+ */
6
+ export declare const buildRelativeUrl: (router: NextRouter, updated?: Record<string, unknown>) => string;
7
+ //#endregion
@@ -1 +1,13 @@
1
- export {};
1
+ import { buildUrl } from "../../../url/buildUrl.mjs";
2
+ //#region src/react/client/nextjs/buildRelativeUrl.ts
3
+ /**
4
+ * Create a new relative URL based on the current path.
5
+ */
6
+ const buildRelativeUrl = (router, updated = {}) => {
7
+ return buildUrl(router.pathname, {
8
+ ...router.query,
9
+ ...updated
10
+ });
11
+ };
12
+ //#endregion
13
+ export { buildRelativeUrl };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "3.1.0",
4
+ "version": "3.1.1",
5
5
  "packageManager": "yarn@4.18.0",
6
6
  "repository": {
7
7
  "type": "git",