@18f/identity-i18n
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,7 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.t = exports.replaceVariables = exports.i18n = exports.I18n = void 0; | ||
const hasOwn = (object, key) => Object.prototype.hasOwnProperty.call(object, key); | ||
@@ -72,4 +66,3 @@ | ||
*/ | ||
const replaceVariables = (string, variables) => string.replace(/%{(\w+)}/g, (match, key) => hasOwn(variables, key) ? variables[key] : match); | ||
exports.replaceVariables = replaceVariables; | ||
export const replaceVariables = (string, variables) => string.replace(/%{(\w+)}/g, (match, key) => hasOwn(variables, key) ? variables[key] : match); | ||
class I18n { | ||
@@ -104,10 +97,8 @@ constructor() { | ||
// eslint-disable-next-line no-underscore-dangle | ||
exports.I18n = I18n; | ||
const i18n = new I18n({ | ||
strings: globalThis._locale_data | ||
}); | ||
exports.i18n = i18n; | ||
const { | ||
t | ||
} = i18n; | ||
exports.t = t; | ||
export { I18n, i18n, t }; |
{ | ||
"name": "@18f/identity-i18n", | ||
"private": false, | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "files": [ |
7170
92