vue-i18n-routing
Advanced tools
Comparing version 1.1.1 to 1.1.2-57f3779
@@ -631,2 +631,20 @@ var VueI18nRouting = function(exports, VueRouter3, vueDemi, vueI18nBridge) { | ||
} | ||
function isV4Route(val) { | ||
return vueDemi.isVue3; | ||
} | ||
function resolveBridgeRoute(val) { | ||
return isV4Route() ? val : val.route; | ||
} | ||
function resolvedRouteToObject(route) { | ||
const r = resolveBridgeRoute(route); | ||
const encodedPath = encodeURI(r.path); | ||
const queryString = r.fullPath.indexOf("?") >= 0 ? r.fullPath.substring(r.fullPath.indexOf("?")) : ""; | ||
const resolvedObject = { | ||
...r, | ||
fullPath: encodedPath + queryString, | ||
path: encodedPath, | ||
href: encodedPath + queryString | ||
}; | ||
return vueDemi.isVue3 ? resolvedObject : { ...route, route: resolvedObject }; | ||
} | ||
function resolve(router, route, strategy, locale) { | ||
@@ -744,4 +762,4 @@ if (vueDemi.isVue3 && strategy === "prefix") { | ||
try { | ||
const resolvedRoute = router.resolve(localizedRoute); | ||
if (vueDemi.isVue3 ? resolvedRoute.name : resolvedRoute.route.name) { | ||
const resolvedRoute = resolvedRouteToObject(router.resolve(localizedRoute)); | ||
if (isV4Route(resolvedRoute) ? resolvedRoute.name : resolvedRoute.route.name) { | ||
return resolvedRoute; | ||
@@ -1142,3 +1160,3 @@ } | ||
} | ||
const VERSION = "1.1.1"; | ||
const VERSION = "1.1.2"; | ||
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL; | ||
@@ -1145,0 +1163,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION; |
@@ -634,2 +634,20 @@ "use strict"; | ||
} | ||
function isV4Route(val) { | ||
return vueDemi.isVue3; | ||
} | ||
function resolveBridgeRoute(val) { | ||
return isV4Route() ? val : val.route; | ||
} | ||
function resolvedRouteToObject(route) { | ||
const r = resolveBridgeRoute(route); | ||
const encodedPath = encodeURI(r.path); | ||
const queryString = r.fullPath.indexOf("?") >= 0 ? r.fullPath.substring(r.fullPath.indexOf("?")) : ""; | ||
const resolvedObject = { | ||
...r, | ||
fullPath: encodedPath + queryString, | ||
path: encodedPath, | ||
href: encodedPath + queryString | ||
}; | ||
return vueDemi.isVue3 ? resolvedObject : { ...route, route: resolvedObject }; | ||
} | ||
function resolve(router, route, strategy, locale) { | ||
@@ -747,4 +765,4 @@ if (vueDemi.isVue3 && strategy === "prefix") { | ||
try { | ||
const resolvedRoute = router.resolve(localizedRoute); | ||
if (vueDemi.isVue3 ? resolvedRoute.name : resolvedRoute.route.name) { | ||
const resolvedRoute = resolvedRouteToObject(router.resolve(localizedRoute)); | ||
if (isV4Route(resolvedRoute) ? resolvedRoute.name : resolvedRoute.route.name) { | ||
return resolvedRoute; | ||
@@ -1145,3 +1163,3 @@ } | ||
} | ||
const VERSION = "1.1.1"; | ||
const VERSION = "1.1.2"; | ||
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL; | ||
@@ -1148,0 +1166,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION; |
{ | ||
"name": "vue-i18n-routing", | ||
"description": "The i18n routing with using vue-i18n", | ||
"version": "1.1.1", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"typecheck": "tsc -p . --noEmit", | ||
"switch:2": "vue-demi-switch 2 vue2 && vue-router-switch 3 vue-router3 && vue-i18n-switch 8 vue-i18n-legacy", | ||
"switch:3": "vue-demi-switch 3 && vue-router-switch 4 && vue-i18n-switch 9", | ||
"test": "vitest run", | ||
"test:watch": "vitest", | ||
"test:cover": "vitest --coverage", | ||
"build:docs": "api-docs-gen ./temp/vue-i18n-routing.api.json -c ./docsgen.config.js -o ./ -g noprefix" | ||
}, | ||
"version": "1.1.2-57f3779", | ||
"dependencies": { | ||
@@ -35,3 +24,3 @@ "@intlify/shared": "^9.4.1", | ||
"vue-router": "^4.1.5", | ||
"vue-router3": "npm:vue-router@3.5.4", | ||
"vue-router3": "npm:vue-router@3.6.5", | ||
"vue-template-compiler": "^2.6.14", | ||
@@ -121,3 +110,14 @@ "vue2": "npm:vue@2.6.14" | ||
}, | ||
"sideEffects": false | ||
} | ||
"sideEffects": false, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"typecheck": "tsc -p . --noEmit", | ||
"switch:2": "vue-demi-switch 2 vue2 && vue-router-switch 3 vue-router3 && vue-i18n-switch 8 vue-i18n-legacy", | ||
"switch:3": "vue-demi-switch 3 && vue-router-switch 4 && vue-i18n-switch 9", | ||
"test": "vitest run", | ||
"test:watch": "vitest", | ||
"test:cover": "vitest --coverage", | ||
"build:docs": "api-docs-gen ./temp/vue-i18n-routing.api.json -c ./docsgen.config.js -o ./ -g noprefix" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
209827
13
5814
1