nuxt-outfit 1.0.7 → 1.0.9
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/module.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ref, reactive } from "vue";
|
|
2
2
|
import { useRuntimeConfig, useNuxtApp, useState } from "#imports";
|
|
3
3
|
import { klona as deepClone } from "klona/full";
|
|
4
|
-
import { unflatten } from "flat";
|
|
5
4
|
import { has, unset } from "lodash-es";
|
|
6
5
|
export const useForm = (opts = {}) => {
|
|
7
6
|
const httpInstance = useRuntimeConfig().public.outfit.httpInstance;
|
|
@@ -51,7 +50,8 @@ export const useForm = (opts = {}) => {
|
|
|
51
50
|
unset(errors.value, field);
|
|
52
51
|
}
|
|
53
52
|
};
|
|
54
|
-
const handleFail = (fail, isRunCallback = true) => {
|
|
53
|
+
const handleFail = async (fail, isRunCallback = true) => {
|
|
54
|
+
const { unflatten } = await import("flat");
|
|
55
55
|
let messages = {};
|
|
56
56
|
const brackets = (text) => text.replace(/[[\].]+/g, ".");
|
|
57
57
|
if (fail.name === "ValidationError") {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useRuntimeConfig, useRequestEvent, useRequestHeaders } from "#imports";
|
|
2
2
|
import { appendHeader } from "h3";
|
|
3
|
-
import { serialize } from "cookie";
|
|
4
3
|
export const useSpaHeaders = (additionalHeaders = {}) => {
|
|
5
4
|
if (process.client) {
|
|
6
5
|
return {
|
|
@@ -15,7 +14,13 @@ export const useSpaHeaders = (additionalHeaders = {}) => {
|
|
|
15
14
|
headers.referer = `${headers.host}/${event.node.req.originalUrl}`;
|
|
16
15
|
}
|
|
17
16
|
const parseCookie = async (cookies) => {
|
|
18
|
-
const
|
|
17
|
+
const [
|
|
18
|
+
{ parse, splitCookiesString: split },
|
|
19
|
+
{ serialize }
|
|
20
|
+
] = await Promise.all([
|
|
21
|
+
import("set-cookie-parser"),
|
|
22
|
+
import("cookie")
|
|
23
|
+
]);
|
|
19
24
|
return parse(split(cookies)).map((cookie) => serialize(cookie.name, cookie.value, cookie));
|
|
20
25
|
};
|
|
21
26
|
const serverOptions = {
|