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

@apitable/i18n

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apitable/i18n - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

dist/lib/index.js

@@ -18,2 +18,4 @@ "use strict";

__exportStar(require("./i18n.class"), exports);
__exportStar(require("./language_pack/loader.interface"), exports);
__exportStar(require("./language_pack/packs.interface"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const i18n_class_1 = require("../lib/i18n.class");
const i18n_errors_1 = require("../lib/i18n.errors");
const lib_1 = require("../lib/");
const mockLanguagePacks = {

@@ -16,3 +16,3 @@ 'en-US': {

it('should get text ok', () => {
const i18n = i18n_class_1.I18N.createByLanguagePacks(mockLanguagePacks);
const i18n = lib_1.I18N.createByLanguagePacks(mockLanguagePacks);
expect(i18n.getText('text1')).toBe('This is text 1');

@@ -27,3 +27,16 @@ i18n.setLanguage('zh-CN');

});
class CustomLoader {
load(language) {
return mockLanguagePacks[language];
}
}
it('should custom loader ok', () => {
const i18n_error = lib_1.I18N.createByLoader(new CustomLoader(), 'any-any');
expect(() => i18n_error.getText('text1')).toThrow(i18n_errors_1.LanguagePackNotFoundError);
const i18n = lib_1.I18N.createByLoader(new CustomLoader());
expect(i18n.getText('text1')).toBe('This is text 1');
i18n.setLanguage('zh-CN');
expect(i18n.getText('text1')).toBe('这是中文1');
});
});
//# sourceMappingURL=i18n.test.js.map

2

package.json
{
"name": "@apitable/i18n",
"version": "1.0.2",
"version": "1.0.3",
"description": "i18n Locales with APITable power.",

@@ -5,0 +5,0 @@ "main": "./dist/lib/index.js",

export * from './i18n.class';
export * from './language_pack/loader.interface';
export * from './language_pack/packs.interface';

Sorry, the diff of this file is not supported yet

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