locale-service 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -34,6 +34,9 @@ function getLocaleFromResources(i) {
34
34
  return lr[i];
35
35
  }
36
36
  function getLocale(l) {
37
+ if (!l) {
38
+ return undefined;
39
+ }
37
40
  var lc = getLocaleFromResources(l);
38
41
  if (!lc) {
39
42
  var newId = map_1.map[l];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locale-service",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Locale Service",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -64,7 +64,10 @@ function getLocaleFromResources(i: string): Locale|undefined {
64
64
  }
65
65
  return lr[i];
66
66
  }
67
- export function getLocale(l: string): Locale|undefined {
67
+ export function getLocale(l?: string | null): Locale|undefined {
68
+ if (!l) {
69
+ return undefined;
70
+ }
68
71
  let lc = getLocaleFromResources(l);
69
72
  if (!lc) {
70
73
  const newId = map[l];