@hybridly/core 0.7.3 → 0.7.4

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/dist/index.cjs CHANGED
@@ -785,7 +785,7 @@ async function performHybridNavigation(options) {
785
785
  utils.debug.router(`Automatically spoofing method ${options.method}.`);
786
786
  if (options.data instanceof FormData) {
787
787
  options.data.append("_method", options.method);
788
- } else if (Object.keys(options.data ?? {}).length) {
788
+ } else if (Object.keys(options.data ?? {}).length >= 0) {
789
789
  Object.assign(options.data, { _method: options.method });
790
790
  } else if (typeof options.data === "undefined") {
791
791
  options.data = { _method: options.method };
@@ -995,7 +995,7 @@ async function navigate(options) {
995
995
  }
996
996
  async function performHybridRequest(targetUrl, options, abortController) {
997
997
  const context = getInternalRouterContext();
998
- const preloaded = getPreloadedRequest(targetUrl);
998
+ const preloaded = options.method === "GET" ? getPreloadedRequest(targetUrl) : false;
999
999
  if (preloaded) {
1000
1000
  utils.debug.router(`Found a pre-loaded request for [${targetUrl}]`);
1001
1001
  discardPreloadedRequest(targetUrl);
package/dist/index.mjs CHANGED
@@ -778,7 +778,7 @@ async function performHybridNavigation(options) {
778
778
  debug.router(`Automatically spoofing method ${options.method}.`);
779
779
  if (options.data instanceof FormData) {
780
780
  options.data.append("_method", options.method);
781
- } else if (Object.keys(options.data ?? {}).length) {
781
+ } else if (Object.keys(options.data ?? {}).length >= 0) {
782
782
  Object.assign(options.data, { _method: options.method });
783
783
  } else if (typeof options.data === "undefined") {
784
784
  options.data = { _method: options.method };
@@ -988,7 +988,7 @@ async function navigate(options) {
988
988
  }
989
989
  async function performHybridRequest(targetUrl, options, abortController) {
990
990
  const context = getInternalRouterContext();
991
- const preloaded = getPreloadedRequest(targetUrl);
991
+ const preloaded = options.method === "GET" ? getPreloadedRequest(targetUrl) : false;
992
992
  if (preloaded) {
993
993
  debug.router(`Found a pre-loaded request for [${targetUrl}]`);
994
994
  discardPreloadedRequest(targetUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybridly/core",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "Core functionality of Hybridly",
5
5
  "keywords": [
6
6
  "hybridly",
@@ -41,9 +41,9 @@
41
41
  "axios": "^1.6.7"
42
42
  },
43
43
  "dependencies": {
44
- "qs": "^6.12.0",
44
+ "qs": "^6.12.1",
45
45
  "superjson": "^2.2.1",
46
- "@hybridly/utils": "0.7.3"
46
+ "@hybridly/utils": "0.7.4"
47
47
  },
48
48
  "devDependencies": {
49
49
  "defu": "^6.1.4"