Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dcloudio/uni-i18n

Package Overview
Dependencies
Maintainers
7
Versions
1060
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dcloudio/uni-i18n - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

11

dist/uni-i18n.cjs.js

@@ -141,2 +141,3 @@ 'use strict';

}
const watchers = [];
var index = {

@@ -151,4 +152,8 @@ init(options) {

setLocale(locale) {
const oldLocale = curLocale;
curLocale = normalizeLocale(locale);
curMessages = messages[curLocale];
watchers.forEach((watcher) => {
watcher(curLocale, oldLocale);
});
},

@@ -158,2 +163,8 @@ getLocale() {

},
watchLocale(fn) {
const index = watchers.push(fn) - 1;
return () => {
watchers.splice(index, 1);
};
},
t(key, values) {

@@ -160,0 +171,0 @@ if (!hasOwn(curMessages, key)) {

3

dist/uni-i18n.d.ts

@@ -8,2 +8,3 @@

getLocale(): BuiltInLocale;
watchLocale(fn: LocaleWatcher): () => void;
t(key: string, values?: Record<string, unknown> | unknown[] | undefined): string;

@@ -23,2 +24,4 @@ };

declare type LocaleWatcher = (newLocale: BuiltInLocale, oldLocale: BuiltInLocale) => void;
export { }

@@ -139,2 +139,3 @@ const isObject = (val) => val !== null && typeof val === 'object';

}
const watchers = [];
var index = {

@@ -149,4 +150,8 @@ init(options) {

setLocale(locale) {
const oldLocale = curLocale;
curLocale = normalizeLocale(locale);
curMessages = messages[curLocale];
watchers.forEach((watcher) => {
watcher(curLocale, oldLocale);
});
},

@@ -156,2 +161,8 @@ getLocale() {

},
watchLocale(fn) {
const index = watchers.push(fn) - 1;
return () => {
watchers.splice(index, 1);
};
},
t(key, values) {

@@ -158,0 +169,0 @@ if (!hasOwn(curMessages, key)) {

2

package.json
{
"name": "@dcloudio/uni-i18n",
"version": "0.0.1",
"version": "0.0.2",
"description": "@dcloudio/uni-i18n",

@@ -5,0 +5,0 @@ "main": "dist/uni-i18n.cjs.js",

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