@gradin/vue-utils 1.0.3 → 1.0.5

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.
@@ -1,6 +1,5 @@
1
- var _a, _b;
2
1
  export const currentYear = new Date().getFullYear();
3
- export const releaseYear = Number((_b = ((_a = import.meta.env) === null || _a === void 0 ? void 0 : _a.VITE_APP_RELEASE_YEAR)) !== null && _b !== void 0 ? _b : 0) || currentYear;
2
+ export const releaseYear = Number((import.meta.env?.VITE_APP_RELEASE_YEAR) ?? 0) || currentYear;
4
3
  export const footerYear = releaseYear === currentYear ? `${currentYear}` : `${releaseYear}-${currentYear}`;
5
4
  export const yearsSinceRelease = currentYear - releaseYear > 0
6
5
  ? Array.from({ length: currentYear - releaseYear + 1 }, (_, i) => currentYear - i)
@@ -1,6 +1,6 @@
1
1
  import { reactive } from "vue";
2
2
  export const resetableReactive = (data) => {
3
- const initialValue = Object.assign({}, data);
3
+ const initialValue = { ...data };
4
4
  const form = reactive(data);
5
5
  Object.defineProperty(form, 'reset', {
6
6
  value: () => {
@@ -9,7 +9,7 @@ export const whenRouteChange = (callback, watchSource) => {
9
9
  const route = useRoute();
10
10
  const routeName = route.name; // cache route name
11
11
  const watchRouteParamsAndQuery = () => JSON.stringify([route.query, route.params]);
12
- watch(watchSource !== null && watchSource !== void 0 ? watchSource : watchRouteParamsAndQuery, () => {
12
+ watch(watchSource ?? watchRouteParamsAndQuery, () => {
13
13
  if (route.name === routeName) {
14
14
  callback();
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradin/vue-utils",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Useful utilities for Vue projects.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,8 @@
8
8
  "scripts": {
9
9
  "build": "tsc",
10
10
  "lint": "eslint . --fix",
11
- "publish": "npm run build"
11
+ "preversion": "npm run build",
12
+ "publish": "np"
12
13
  },
13
14
  "files": [
14
15
  "dist"
@@ -35,16 +36,16 @@
35
36
  },
36
37
  "homepage": "https://github.com/gradints/vue-utils#readme",
37
38
  "dependencies": {
38
- "vue": "^3.5.30"
39
+ "vue": "^3.5.40"
39
40
  },
40
41
  "devDependencies": {
41
42
  "@eslint/js": "^10.0.1",
42
43
  "@stylistic/eslint-plugin": "^5.10.0",
43
- "eslint-plugin-simple-import-sort": "^12.1.1",
44
- "typescript": "^5.9.3",
45
- "typescript-eslint": "^8.57.2"
44
+ "eslint-plugin-simple-import-sort": "^14.0.0",
45
+ "typescript": "^6.0.3",
46
+ "typescript-eslint": "^8.65.0"
46
47
  },
47
48
  "peerDependencies": {
48
- "vue-router": "^4.6.3 || ^5.0.0"
49
+ "vue-router": "^4.6.3 || ^5.2.0"
49
50
  }
50
51
  }
File without changes