Huge News!Announcing our $40M Series B led by Abstract Ventures.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.2 to 0.13.3-3ba7b66

./dist/vue-i18n-routing.js

6

dist/vue-i18n-routing.d.ts
import type { Composer } from '@intlify/vue-i18n-bridge';
import type { ComposerExtender } from '@intlify/vue-i18n-bridge';
import { EffectScope } from 'vue-demi';

@@ -19,2 +20,3 @@ import type { ExportedGlobalComposer } from '@intlify/vue-i18n-bridge';

import type { VueI18n } from '@intlify/vue-i18n-bridge';
import type { VueI18nExtender } from '@intlify/vue-i18n-bridge';
import type { VueRouter } from '@intlify/vue-router-bridge';

@@ -915,7 +917,7 @@

*/
__composerExtend?: (composer: Composer) => void;
__composerExtend?: ComposerExtender;
/**
* @internal
*/
__vueI18nExtend?: (vueI18n: VueI18n) => void;
__vueI18nExtend?: VueI18nExtender;
}

@@ -922,0 +924,0 @@

@@ -18,3 +18,3 @@ var VueI18nRouting = function(exports, VueRouter3, vueDemi, vueI18nBridge) {

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

@@ -339,18 +339,26 @@ * Released under the MIT License.

const orgComposerExtend = pluginOptions.__composerExtend;
pluginOptions.__composerExtend = (c) => {
const g = getComposer(i18n);
c.locales = vueDemi.computed(() => g.locales.value);
c.localeCodes = vueDemi.computed(() => g.localeCodes.value);
c.baseUrl = vueDemi.computed(() => g.baseUrl.value);
pluginOptions.__composerExtend = (localComposer) => {
const globalComposer2 = getComposer(i18n);
localComposer.locales = vueDemi.computed(() => globalComposer2.locales.value);
localComposer.localeCodes = vueDemi.computed(() => globalComposer2.localeCodes.value);
localComposer.baseUrl = vueDemi.computed(() => globalComposer2.baseUrl.value);
let orgComposerDispose;
if (isFunction(orgComposerExtend)) {
Reflect.apply(orgComposerExtend, pluginOptions, [c]);
orgComposerDispose = Reflect.apply(orgComposerExtend, pluginOptions, [globalComposer2]);
}
return () => {
orgComposerDispose && orgComposerDispose();
};
};
if (isVueI18n(i18n.global)) {
if (i18n.mode === "legacy") {
const orgVueI18nExtend = pluginOptions.__vueI18nExtend;
pluginOptions.__vueI18nExtend = (vueI18n) => {
extendVueI18n(vueI18n, hooks.onExtendVueI18n);
let orgVueI18nDispose;
if (isFunction(orgVueI18nExtend)) {
Reflect.apply(orgVueI18nExtend, pluginOptions, [vueI18n]);
orgVueI18nDispose = Reflect.apply(orgVueI18nExtend, pluginOptions, [vueI18n]);
}
return () => {
orgVueI18nDispose && orgVueI18nDispose();
};
};

@@ -360,11 +368,13 @@ }

Reflect.apply(orgInstall, i18n, [vue, ...options]);
const composer = getComposer(i18n);
scope.run(() => extendComposer(composer, { locales, localeCodes, baseUrl, hooks, context }));
if (isVueI18n(i18n.global)) {
extendVueI18n(i18n.global, hooks.onExtendVueI18n);
}
const globalComposer = getComposer(i18n);
scope.run(() => {
extendComposer(globalComposer, { locales, localeCodes, baseUrl, hooks, context });
if (i18n.mode === "legacy" && isVueI18n(i18n.global)) {
extendVueI18n(i18n.global, hooks.onExtendVueI18n);
}
});
const app = vue;
const exported = i18n.mode === "composition" ? vueDemi.isVue3 ? app.config.globalProperties.$i18n : i18n : vueDemi.isVue2 ? i18n : null;
if (exported) {
extendExportedGlobal(exported, composer, hooks.onExtendExportedGlobal);
extendExportedGlobal(exported, globalComposer, hooks.onExtendExportedGlobal);
}

@@ -417,3 +427,3 @@ if (pluginOptions.inject) {

}
function extendExportedGlobal(exported, g, hook) {
function extendProperyDescripters(composer, exported, hook) {
const properties = [

@@ -423,30 +433,2 @@ {

get() {
return g.locales.value;
}
},
localeCodes: {
get() {
return g.localeCodes.value;
}
},
baseUrl: {
get() {
return g.baseUrl.value;
}
}
}
];
hook && properties.push(hook(g));
for (const property of properties) {
for (const [key, descriptor] of Object.entries(property)) {
Object.defineProperty(exported, key, descriptor);
}
}
}
function extendVueI18n(vueI18n, hook) {
const composer = getComposer(vueI18n);
const properties = [
{
locales: {
get() {
return composer.locales.value;

@@ -470,6 +452,13 @@ }

for (const [key, descriptor] of Object.entries(property)) {
Object.defineProperty(vueI18n, key, descriptor);
Object.defineProperty(exported, key, descriptor);
}
}
}
function extendExportedGlobal(exported, g, hook) {
extendProperyDescripters(g, exported, hook);
}
function extendVueI18n(vueI18n, hook) {
const c = getComposer(vueI18n);
extendProperyDescripters(c, vueI18n, hook);
}
function isPluginOptions(options) {

@@ -1142,3 +1131,3 @@ return isObject(options) && ("inject" in options || "__composerExtend" in options || "__vueI18nExtend" in options);

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

@@ -1145,0 +1134,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION;

@@ -21,3 +21,3 @@ "use strict";

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

@@ -342,18 +342,26 @@ * Released under the MIT License.

const orgComposerExtend = pluginOptions.__composerExtend;
pluginOptions.__composerExtend = (c) => {
const g = getComposer(i18n);
c.locales = vueDemi.computed(() => g.locales.value);
c.localeCodes = vueDemi.computed(() => g.localeCodes.value);
c.baseUrl = vueDemi.computed(() => g.baseUrl.value);
pluginOptions.__composerExtend = (localComposer) => {
const globalComposer2 = getComposer(i18n);
localComposer.locales = vueDemi.computed(() => globalComposer2.locales.value);
localComposer.localeCodes = vueDemi.computed(() => globalComposer2.localeCodes.value);
localComposer.baseUrl = vueDemi.computed(() => globalComposer2.baseUrl.value);
let orgComposerDispose;
if (isFunction(orgComposerExtend)) {
Reflect.apply(orgComposerExtend, pluginOptions, [c]);
orgComposerDispose = Reflect.apply(orgComposerExtend, pluginOptions, [globalComposer2]);
}
return () => {
orgComposerDispose && orgComposerDispose();
};
};
if (isVueI18n(i18n.global)) {
if (i18n.mode === "legacy") {
const orgVueI18nExtend = pluginOptions.__vueI18nExtend;
pluginOptions.__vueI18nExtend = (vueI18n) => {
extendVueI18n(vueI18n, hooks.onExtendVueI18n);
let orgVueI18nDispose;
if (isFunction(orgVueI18nExtend)) {
Reflect.apply(orgVueI18nExtend, pluginOptions, [vueI18n]);
orgVueI18nDispose = Reflect.apply(orgVueI18nExtend, pluginOptions, [vueI18n]);
}
return () => {
orgVueI18nDispose && orgVueI18nDispose();
};
};

@@ -363,11 +371,13 @@ }

Reflect.apply(orgInstall, i18n, [vue, ...options]);
const composer = getComposer(i18n);
scope.run(() => extendComposer(composer, { locales, localeCodes, baseUrl, hooks, context }));
if (isVueI18n(i18n.global)) {
extendVueI18n(i18n.global, hooks.onExtendVueI18n);
}
const globalComposer = getComposer(i18n);
scope.run(() => {
extendComposer(globalComposer, { locales, localeCodes, baseUrl, hooks, context });
if (i18n.mode === "legacy" && isVueI18n(i18n.global)) {
extendVueI18n(i18n.global, hooks.onExtendVueI18n);
}
});
const app = vue;
const exported = i18n.mode === "composition" ? vueDemi.isVue3 ? app.config.globalProperties.$i18n : i18n : vueDemi.isVue2 ? i18n : null;
if (exported) {
extendExportedGlobal(exported, composer, hooks.onExtendExportedGlobal);
extendExportedGlobal(exported, globalComposer, hooks.onExtendExportedGlobal);
}

@@ -420,3 +430,3 @@ if (pluginOptions.inject) {

}
function extendExportedGlobal(exported, g, hook) {
function extendProperyDescripters(composer, exported, hook) {
const properties = [

@@ -426,30 +436,2 @@ {

get() {
return g.locales.value;
}
},
localeCodes: {
get() {
return g.localeCodes.value;
}
},
baseUrl: {
get() {
return g.baseUrl.value;
}
}
}
];
hook && properties.push(hook(g));
for (const property of properties) {
for (const [key, descriptor] of Object.entries(property)) {
Object.defineProperty(exported, key, descriptor);
}
}
}
function extendVueI18n(vueI18n, hook) {
const composer = getComposer(vueI18n);
const properties = [
{
locales: {
get() {
return composer.locales.value;

@@ -473,6 +455,13 @@ }

for (const [key, descriptor] of Object.entries(property)) {
Object.defineProperty(vueI18n, key, descriptor);
Object.defineProperty(exported, key, descriptor);
}
}
}
function extendExportedGlobal(exported, g, hook) {
extendProperyDescripters(g, exported, hook);
}
function extendVueI18n(vueI18n, hook) {
const c = getComposer(vueI18n);
extendProperyDescripters(c, vueI18n, hook);
}
function isPluginOptions(options) {

@@ -1145,3 +1134,3 @@ return isObject(options) && ("inject" in options || "__composerExtend" in options || "__vueI18nExtend" in options);

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

@@ -1148,0 +1137,0 @@ exports.DEFAULT_DETECTION_DIRECTION = DEFAULT_DETECTION_DIRECTION;

{
"name": "vue-i18n-routing",
"description": "The i18n routing with using vue-i18n",
"version": "0.13.2",
"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": "0.13.3-3ba7b66",
"dependencies": {

@@ -31,3 +20,3 @@ "@intlify/shared": "next",

"vue": "^3.2.27",
"vue-i18n": "npm:vue-i18n@next",
"vue-i18n": "npm:vue-i18n@9.3.0-beta.26",
"vue-i18n-bridge": "next",

@@ -121,3 +110,14 @@ "vue-i18n-legacy": "npm:vue-i18n@8",

},
"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

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