@vesperjs/shared 0.9.5 → 0.9.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.
- package/dist/index.d.mts +12 -1
- package/dist/index.mjs +14 -3
- package/package.json +6 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Ref, WritableComputedRef } from "@vue/reactivity";
|
|
2
|
+
import { Parser } from "bowser";
|
|
2
3
|
|
|
3
4
|
//#region src/types/error/backend-error-info.d.ts
|
|
4
5
|
interface BackendErrorInfo<BER extends object> {
|
|
@@ -40,6 +41,16 @@ declare const useExternalErrors: <P extends string>(flash: Ref<Flash>) => {
|
|
|
40
41
|
isSuccess: () => boolean;
|
|
41
42
|
};
|
|
42
43
|
//#endregion
|
|
44
|
+
//#region src/composables/user-agent/use-browser-info.d.ts
|
|
45
|
+
declare const useBrowserInfo: () => {
|
|
46
|
+
browserInfo: Parser.Parser;
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/composables/user-agent/use-user-agent.d.ts
|
|
50
|
+
declare const useUserAgent: () => {
|
|
51
|
+
userAgent: Parser.ParsedResult;
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
43
54
|
//#region src/composables/util/use-date.d.ts
|
|
44
55
|
declare const useDate: (fmtDate?: string, locale?: string) => {
|
|
45
56
|
isValidDate: (value: string) => boolean;
|
|
@@ -67,4 +78,4 @@ declare const useFlash: () => {
|
|
|
67
78
|
clearFlash: () => void;
|
|
68
79
|
};
|
|
69
80
|
//#endregion
|
|
70
|
-
export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, useBackendErrorInfo, useDate, useEntity, useExternalErrors, useFlash };
|
|
81
|
+
export { type BackendErrorInfo, type BackendErrorResource, type ErrorMessages, type ErrorsResource, type Flash, useBackendErrorInfo, useBrowserInfo, useDate, useEntity, useExternalErrors, useFlash, useUserAgent };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { computed, ref } from "@vue/reactivity";
|
|
2
|
-
import { parse } from "
|
|
2
|
+
import { getParser, parse } from "bowser";
|
|
3
|
+
import { parse as parse$1 } from "@formkit/tempo";
|
|
3
4
|
//#region src/composables/backend/error/use-backend-error-info.ts
|
|
4
5
|
const useBackendErrorInfo = function() {
|
|
5
6
|
const backendErrorInfo = ref({});
|
|
@@ -39,11 +40,21 @@ const useExternalErrors = function(flash) {
|
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
42
|
//#endregion
|
|
43
|
+
//#region src/composables/user-agent/use-browser-info.ts
|
|
44
|
+
const useBrowserInfo = function() {
|
|
45
|
+
return { browserInfo: getParser(globalThis.navigator.userAgent) };
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/composables/user-agent/use-user-agent.ts
|
|
49
|
+
const useUserAgent = function() {
|
|
50
|
+
return { userAgent: parse(globalThis.navigator.userAgent) };
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
42
53
|
//#region src/composables/util/use-date.ts
|
|
43
54
|
const useDate = function(fmtDate = "YYYY/MM/DD", locale) {
|
|
44
55
|
const isValidDate = (value) => {
|
|
45
56
|
try {
|
|
46
|
-
const date = value ? parse(value, fmtDate, locale) : null;
|
|
57
|
+
const date = value ? parse$1(value, fmtDate, locale) : null;
|
|
47
58
|
return date instanceof Date && !isNaN(date.getTime());
|
|
48
59
|
} catch {
|
|
49
60
|
return false;
|
|
@@ -80,4 +91,4 @@ const useFlash = function() {
|
|
|
80
91
|
};
|
|
81
92
|
};
|
|
82
93
|
//#endregion
|
|
83
|
-
export { useBackendErrorInfo, useDate, useEntity, useExternalErrors, useFlash };
|
|
94
|
+
export { useBackendErrorInfo, useBrowserInfo, useDate, useEntity, useExternalErrors, useFlash, useUserAgent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesperjs/shared",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Nuxt",
|
|
6
6
|
"vue.js"
|
|
@@ -20,22 +20,23 @@
|
|
|
20
20
|
"./package.json": "./package.json"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@formkit/tempo": "^1.1.0"
|
|
23
|
+
"@formkit/tempo": "^1.1.0",
|
|
24
|
+
"bowser": "^2.14.1"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
27
|
"@eslint/js": "^10.0.1",
|
|
27
28
|
"@typescript-eslint/eslint-plugin": "^8.60.1",
|
|
28
29
|
"@typescript-eslint/parser": "^8.60.1",
|
|
29
|
-
"@vue/eslint-config-typescript": "^14.
|
|
30
|
+
"@vue/eslint-config-typescript": "^14.8.0",
|
|
30
31
|
"eslint": "^10.4.1",
|
|
31
32
|
"eslint-plugin-vue": "^10.9.2",
|
|
32
33
|
"oxfmt": "^0.53.0",
|
|
33
|
-
"tsdown": "^0.22.
|
|
34
|
+
"tsdown": "^0.22.2",
|
|
34
35
|
"typescript": "^6.0.3",
|
|
35
36
|
"typescript-eslint": "^8.60.1"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
|
-
"@vue/reactivity": "^3.5.35 || ^3.6.0-beta.
|
|
39
|
+
"@vue/reactivity": "^3.5.35 || ^3.6.0-beta.14"
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
42
|
"build": "tsdown --dts",
|