New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-i18n-routing

Package Overview
Dependencies
Maintainers
1
Versions
239
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-i18n-routing - npm Package Compare versions

Comparing version 0.13.1 to 0.13.2

2

dist/vue-i18n-routing.d.ts

@@ -760,3 +760,3 @@ import type { Composer } from '@intlify/vue-i18n-bridge';

*/
export declare type Strategies = typeof STRATEGIES[keyof typeof STRATEGIES];
export declare type Strategies = (typeof STRATEGIES)[keyof typeof STRATEGIES];

@@ -763,0 +763,0 @@ /**

var VueI18nRouting = function(exports, VueRouter3, vueDemi, vueI18nBridge) {
"use strict";
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
const VueRouter3__default = /* @__PURE__ */ _interopDefaultLegacy(VueRouter3);
const STRATEGIES = {

@@ -20,3 +18,3 @@ PREFIX: "prefix",

/*!
* shared v9.3.0-beta.16
* shared v9.3.0-beta.25
* (c) 2023 kazuya kawaguchi

@@ -195,3 +193,4 @@ * Released under the MIT License.

const isChildWithRelativePath = isChild && !path.startsWith("/");
return !isChildWithRelativePath && !(isDefaultLocale && strategy === "prefix_except_default");
return !isChildWithRelativePath && // skip default locale if strategy is 'prefix_except_default'
!(isDefaultLocale && strategy === "prefix_except_default");
}

@@ -321,2 +320,3 @@ const DefaultLocalizeRoutesPrefixable = prefixable$1;

},
// eslint-disable-next-line prefer-rest-params
arguments

@@ -485,4 +485,3 @@ );

function getGlobalOptions(router) {
var _a;
return (_a = router[GlobalOptionsRegistory]) != null ? _a : {};
return router[GlobalOptionsRegistory] ?? {};
}

@@ -549,3 +548,3 @@ function createRouter(i18n, options = {}) {

} else if (vueDemi.isVue2 && version === 3) {
return new VueRouter3__default.default(options);
return new VueRouter3(options);
} else {

@@ -588,17 +587,16 @@ throw new Error("TODO:");

function asDefaultVueI18nRouterOptions(options) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
options.version = (_a = options.version) != null ? _a : 4;
options.defaultLocale = (_b = options.defaultLocale) != null ? _b : DEFAULT_LOCALE;
options.strategy = (_c = options.strategy) != null ? _c : DEFAULT_STRATEGY;
options.trailingSlash = (_d = options.trailingSlash) != null ? _d : DEFAULT_TRAILING_SLASH;
options.routesNameSeparator = (_e = options.routesNameSeparator) != null ? _e : DEFAULT_ROUTES_NAME_SEPARATOR;
options.defaultLocaleRouteNameSuffix = (_f = options.defaultLocaleRouteNameSuffix) != null ? _f : DEFAULT_LOCALE_ROUTE_NAME_SUFFIX;
options.locales = (_g = options.locales) != null ? _g : [];
options.defaultDirection = (_h = options.defaultDirection) != null ? _h : DEFAULT_DETECTION_DIRECTION;
options.baseUrl = (_i = options.baseUrl) != null ? _i : DEFAULT_BASE_URL;
options.routes = (_j = options.routes) != null ? _j : [];
options.prefixable = (_k = options.prefixable) != null ? _k : DefaultPrefixable;
options.switchLocalePathIntercepter = (_l = options.switchLocalePathIntercepter) != null ? _l : DefaultSwitchLocalePathIntercepter;
options.localizeRoutesPrefixable = (_m = options.localizeRoutesPrefixable) != null ? _m : DefaultLocalizeRoutesPrefixable;
options.dynamicRouteParamsKey = (_n = options.dynamicRouteParamsKey) != null ? _n : DEFAULT_DYNAMIC_PARAMS_KEY;
options.version = options.version ?? 4;
options.defaultLocale = options.defaultLocale ?? DEFAULT_LOCALE;
options.strategy = options.strategy ?? DEFAULT_STRATEGY;
options.trailingSlash = options.trailingSlash ?? DEFAULT_TRAILING_SLASH;
options.routesNameSeparator = options.routesNameSeparator ?? DEFAULT_ROUTES_NAME_SEPARATOR;
options.defaultLocaleRouteNameSuffix = options.defaultLocaleRouteNameSuffix ?? DEFAULT_LOCALE_ROUTE_NAME_SUFFIX;
options.locales = options.locales ?? [];
options.defaultDirection = options.defaultDirection ?? DEFAULT_DETECTION_DIRECTION;
options.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
options.routes = options.routes ?? [];
options.prefixable = options.prefixable ?? DefaultPrefixable;
options.switchLocalePathIntercepter = options.switchLocalePathIntercepter ?? DefaultSwitchLocalePathIntercepter;
options.localizeRoutesPrefixable = options.localizeRoutesPrefixable ?? DefaultLocalizeRoutesPrefixable;
options.dynamicRouteParamsKey = options.dynamicRouteParamsKey ?? DEFAULT_DYNAMIC_PARAMS_KEY;
return options;

@@ -659,3 +657,4 @@ }

const isDefaultLocale = currentLocale === defaultLocale;
return !(isDefaultLocale && RESOLVED_PREFIXED.has(strategy)) && !(strategy === "no_prefix");
return !(isDefaultLocale && RESOLVED_PREFIXED.has(strategy)) && // no prefix for any language
!(strategy === "no_prefix");
}

@@ -693,3 +692,5 @@ const DefaultPrefixable = prefixable;

if (_route[0] === "/") {
_route = { path: route };
const [path, search] = route.split("?");
const query = Object.fromEntries(new URLSearchParams(search));
_route = { path, query };
} else {

@@ -883,2 +884,3 @@ _route = { name: route };

...route,
// eslint-disable-line @typescript-eslint/no-explicit-any
name: getRouteBaseName.call(this, route)

@@ -927,2 +929,3 @@ });

property: "og:locale",
// Replace dash with underscore as defined in spec: language_TERRITORY
content: hypenToUnderscore(currentLocaleIso)

@@ -1129,2 +1132,3 @@ });

const handler = _router.afterEach(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(to, from) => {

@@ -1143,3 +1147,3 @@ cleanMeta();

}
const VERSION = "0.13.1";
const VERSION = "0.13.2";
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL;

@@ -1191,4 +1195,4 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION;

exports.useSwitchLocalePath = useSwitchLocalePath;
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
return exports;
}({}, VueRouter, VueDemi, VueI18n);
"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const VueRouter3 = require("@intlify/vue-router-bridge");
const vueDemi = require("vue-demi");
const vueI18nBridge = require("@intlify/vue-i18n-bridge");
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
const VueRouter3__default = /* @__PURE__ */ _interopDefaultLegacy(VueRouter3);
const STRATEGIES = {

@@ -23,3 +21,3 @@ PREFIX: "prefix",

/*!
* shared v9.3.0-beta.16
* shared v9.3.0-beta.25
* (c) 2023 kazuya kawaguchi

@@ -198,3 +196,4 @@ * Released under the MIT License.

const isChildWithRelativePath = isChild && !path.startsWith("/");
return !isChildWithRelativePath && !(isDefaultLocale && strategy === "prefix_except_default");
return !isChildWithRelativePath && // skip default locale if strategy is 'prefix_except_default'
!(isDefaultLocale && strategy === "prefix_except_default");
}

@@ -324,2 +323,3 @@ const DefaultLocalizeRoutesPrefixable = prefixable$1;

},
// eslint-disable-next-line prefer-rest-params
arguments

@@ -488,4 +488,3 @@ );

function getGlobalOptions(router) {
var _a;
return (_a = router[GlobalOptionsRegistory]) != null ? _a : {};
return router[GlobalOptionsRegistory] ?? {};
}

@@ -552,3 +551,3 @@ function createRouter(i18n, options = {}) {

} else if (vueDemi.isVue2 && version === 3) {
return new VueRouter3__default.default(options);
return new VueRouter3(options);
} else {

@@ -591,17 +590,16 @@ throw new Error("TODO:");

function asDefaultVueI18nRouterOptions(options) {
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
options.version = (_a = options.version) != null ? _a : 4;
options.defaultLocale = (_b = options.defaultLocale) != null ? _b : DEFAULT_LOCALE;
options.strategy = (_c = options.strategy) != null ? _c : DEFAULT_STRATEGY;
options.trailingSlash = (_d = options.trailingSlash) != null ? _d : DEFAULT_TRAILING_SLASH;
options.routesNameSeparator = (_e = options.routesNameSeparator) != null ? _e : DEFAULT_ROUTES_NAME_SEPARATOR;
options.defaultLocaleRouteNameSuffix = (_f = options.defaultLocaleRouteNameSuffix) != null ? _f : DEFAULT_LOCALE_ROUTE_NAME_SUFFIX;
options.locales = (_g = options.locales) != null ? _g : [];
options.defaultDirection = (_h = options.defaultDirection) != null ? _h : DEFAULT_DETECTION_DIRECTION;
options.baseUrl = (_i = options.baseUrl) != null ? _i : DEFAULT_BASE_URL;
options.routes = (_j = options.routes) != null ? _j : [];
options.prefixable = (_k = options.prefixable) != null ? _k : DefaultPrefixable;
options.switchLocalePathIntercepter = (_l = options.switchLocalePathIntercepter) != null ? _l : DefaultSwitchLocalePathIntercepter;
options.localizeRoutesPrefixable = (_m = options.localizeRoutesPrefixable) != null ? _m : DefaultLocalizeRoutesPrefixable;
options.dynamicRouteParamsKey = (_n = options.dynamicRouteParamsKey) != null ? _n : DEFAULT_DYNAMIC_PARAMS_KEY;
options.version = options.version ?? 4;
options.defaultLocale = options.defaultLocale ?? DEFAULT_LOCALE;
options.strategy = options.strategy ?? DEFAULT_STRATEGY;
options.trailingSlash = options.trailingSlash ?? DEFAULT_TRAILING_SLASH;
options.routesNameSeparator = options.routesNameSeparator ?? DEFAULT_ROUTES_NAME_SEPARATOR;
options.defaultLocaleRouteNameSuffix = options.defaultLocaleRouteNameSuffix ?? DEFAULT_LOCALE_ROUTE_NAME_SUFFIX;
options.locales = options.locales ?? [];
options.defaultDirection = options.defaultDirection ?? DEFAULT_DETECTION_DIRECTION;
options.baseUrl = options.baseUrl ?? DEFAULT_BASE_URL;
options.routes = options.routes ?? [];
options.prefixable = options.prefixable ?? DefaultPrefixable;
options.switchLocalePathIntercepter = options.switchLocalePathIntercepter ?? DefaultSwitchLocalePathIntercepter;
options.localizeRoutesPrefixable = options.localizeRoutesPrefixable ?? DefaultLocalizeRoutesPrefixable;
options.dynamicRouteParamsKey = options.dynamicRouteParamsKey ?? DEFAULT_DYNAMIC_PARAMS_KEY;
return options;

@@ -662,3 +660,4 @@ }

const isDefaultLocale = currentLocale === defaultLocale;
return !(isDefaultLocale && RESOLVED_PREFIXED.has(strategy)) && !(strategy === "no_prefix");
return !(isDefaultLocale && RESOLVED_PREFIXED.has(strategy)) && // no prefix for any language
!(strategy === "no_prefix");
}

@@ -696,3 +695,5 @@ const DefaultPrefixable = prefixable;

if (_route[0] === "/") {
_route = { path: route };
const [path, search] = route.split("?");
const query = Object.fromEntries(new URLSearchParams(search));
_route = { path, query };
} else {

@@ -886,2 +887,3 @@ _route = { name: route };

...route,
// eslint-disable-line @typescript-eslint/no-explicit-any
name: getRouteBaseName.call(this, route)

@@ -930,2 +932,3 @@ });

property: "og:locale",
// Replace dash with underscore as defined in spec: language_TERRITORY
content: hypenToUnderscore(currentLocaleIso)

@@ -1132,2 +1135,3 @@ });

const handler = _router.afterEach(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(to, from) => {

@@ -1146,3 +1150,3 @@ cleanMeta();

}
const VERSION = "0.13.1";
const VERSION = "0.13.2";
exports.DEFAULT_BASE_URL = DEFAULT_BASE_URL;

@@ -1149,0 +1153,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION;

{
"name": "vue-i18n-routing",
"description": "The i18n routing with using vue-i18n",
"version": "0.13.1",
"version": "0.13.2",
"scripts": {

@@ -20,4 +20,4 @@ "dev": "vite",

"@intlify/vue-router-bridge": "^0.8.0",
"ufo": "^1.0.0",
"vue-demi": "^0.13.11"
"ufo": "^1.2.0",
"vue-demi": "^0.14.5"
},

@@ -27,6 +27,6 @@ "devDependencies": {

"api-docs-gen": "^0.4.0",
"typescript": "^4.8.4",
"vite": "^3.2.2",
"vite-plugin-dts": "^0.9.6",
"vitest": "^0.25.2",
"typescript": "^5.1.6",
"vite": "^4.4.9",
"vite-plugin-dts": "^3.5.1",
"vitest": "^0.34.1",
"vue": "^3.2.27",

@@ -33,0 +33,0 @@ "vue-i18n": "npm:vue-i18n@next",

@@ -9,3 +9,3 @@ # vue-i18n-routing

About details, See the [API References]('./api.md)
About details, See the [API References](./api.md)

@@ -12,0 +12,0 @@ ## ©️ License

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc