@hybridly/core 0.7.6 → 0.7.8

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,10 +785,10 @@ 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 >= 0) {
789
- Object.assign(options.data, { _method: options.method });
790
788
  } else if (typeof options.data === "undefined") {
791
789
  options.data = { _method: options.method };
790
+ } else if (options.data instanceof Object && Object.keys(options.data).length >= 0) {
791
+ Object.assign(options.data, { _method: options.method });
792
792
  } else {
793
793
  utils.debug.router("Could not spoof method because body type is not supported.", options.data);
794
794
  }
package/dist/index.d.cts CHANGED
@@ -218,7 +218,7 @@ interface HybridRequestOptions extends Omit<NavigationOptions, 'payload'> {
218
218
  useFormData?: boolean;
219
219
  /**
220
220
  * If `false`, disable automatic form spoofing.
221
- * @see https://laravel.com/docs/9.x/routing#form-method-spoofing
221
+ * @see https://laravel.com/docs/master/routing#form-method-spoofing
222
222
  */
223
223
  spoof?: boolean;
224
224
  /**
package/dist/index.d.mts CHANGED
@@ -218,7 +218,7 @@ interface HybridRequestOptions extends Omit<NavigationOptions, 'payload'> {
218
218
  useFormData?: boolean;
219
219
  /**
220
220
  * If `false`, disable automatic form spoofing.
221
- * @see https://laravel.com/docs/9.x/routing#form-method-spoofing
221
+ * @see https://laravel.com/docs/master/routing#form-method-spoofing
222
222
  */
223
223
  spoof?: boolean;
224
224
  /**
package/dist/index.d.ts CHANGED
@@ -218,7 +218,7 @@ interface HybridRequestOptions extends Omit<NavigationOptions, 'payload'> {
218
218
  useFormData?: boolean;
219
219
  /**
220
220
  * If `false`, disable automatic form spoofing.
221
- * @see https://laravel.com/docs/9.x/routing#form-method-spoofing
221
+ * @see https://laravel.com/docs/master/routing#form-method-spoofing
222
222
  */
223
223
  spoof?: boolean;
224
224
  /**
package/dist/index.mjs CHANGED
@@ -778,10 +778,10 @@ 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 >= 0) {
782
- Object.assign(options.data, { _method: options.method });
783
781
  } else if (typeof options.data === "undefined") {
784
782
  options.data = { _method: options.method };
783
+ } else if (options.data instanceof Object && Object.keys(options.data).length >= 0) {
784
+ Object.assign(options.data, { _method: options.method });
785
785
  } else {
786
786
  debug.router("Could not spoof method because body type is not supported.", options.data);
787
787
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hybridly/core",
3
- "version": "0.7.6",
3
+ "version": "0.7.8",
4
4
  "description": "Core functionality of Hybridly",
5
5
  "keywords": [
6
6
  "hybridly",
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "qs": "^6.12.1",
45
45
  "superjson": "^2.2.1",
46
- "@hybridly/utils": "0.7.6"
46
+ "@hybridly/utils": "0.7.8"
47
47
  },
48
48
  "devDependencies": {
49
49
  "defu": "^6.1.4"