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

bobril-g11n

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bobril-g11n - npm Package Compare versions

Comparing version 1.4.0 to 2.0.0

9

CHANGELOG.md
CHANGELOG
===
2.0.0
--
Breaking changes
-
Requires Bobril 4.44.0 or higher, but does not depend on it in package.json. Bobril needs to be required sooner than bobril-g11n.
When setLocale fails it will revoke returned promise. Additionaly it will try to revert to default locale before.
1.4.0

@@ -5,0 +14,0 @@ --

4

package.json
{
"name": "bobril-g11n",
"version": "1.4.0",
"version": "2.0.0",
"description": "Bobril globalization",

@@ -11,3 +11,2 @@ "main": "index.js",

"dependencies": {
"bobril": "*",
"moment": "^2.10.6",

@@ -17,2 +16,3 @@ "numeral": "^1.5.3"

"devDependencies": {
"bobril": "^4.44.0",
"graceful-fs": "*",

@@ -19,0 +19,0 @@ "gulp": "^3.9.0",

"use strict";
var msgFormatParser = require("./msgFormatParser");
var msgFormatter = require('./msgFormatter');
var b = require('bobril');
var jsonp_1 = require('./jsonp');

@@ -74,3 +73,3 @@ var localeDataStorage = require('./localeDataStorage');

b.setBeforeInit(function (cb) {
initPromise.then(cb);
initPromise.then(cb, cb);
});

@@ -81,3 +80,3 @@ function initGlobalization(config) {

}
b.assign(cfg, config);
Object.assign(cfg, config);
initWasStarted = true;

@@ -104,3 +103,7 @@ if (currentLocale.length !== 0) {

return jsonp_1.jsonp(p_1);
}).then(null, function (e) { return console.warn(e); });
}).then(null, function (e) {
console.warn(e);
if (locale != cfg.defaultLocale)
return setLocale(cfg.defaultLocale).then(function () { return Promise.reject(e); });
});
}

@@ -107,0 +110,0 @@ }

import * as msgFormatParser from "./msgFormatParser";
import * as msgFormatter from './msgFormatter';
import * as b from 'bobril';
import { jsonp } from './jsonp';
import * as localeDataStorage from './localeDataStorage';
declare var b: {
setBeforeInit(callback: (cb: () => void) => void): void;
ignoreShouldChange(): void;
};
export interface IG11NConfig {

@@ -86,10 +90,10 @@ defaultLocale?: string;

b.setBeforeInit((cb: (_: any) => void) => {
initPromise.then(cb);
initPromise.then(cb, cb);
});
export function initGlobalization(config?: IG11NConfig): Promise<any> {
export function initGlobalization(config?: IG11NConfig): Promise<void> {
if (initWasStarted) {
throw new Error('initLocalization must be called only once');
}
b.assign(cfg, config);
Object.assign(cfg, config);
initWasStarted = true;

@@ -116,3 +120,7 @@ if (currentLocale.length !== 0) {

return jsonp(p);
}).then(null, (e) => console.warn(e));
}).then(null, (e) => {
console.warn(e);
if (locale != cfg.defaultLocale)
return setLocale(cfg.defaultLocale).then(() => Promise.reject(e));
});
}

@@ -119,0 +127,0 @@ }

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