@transifex/native
Advanced tools
Comparing version 7.1.2 to 7.1.3
{ | ||
"name": "@transifex/native", | ||
"version": "7.1.2", | ||
"version": "7.1.3", | ||
"description": "i18n framework using Transifex Native", | ||
@@ -56,6 +56,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@messageformat/core": "^3.3.0", | ||
"cross-fetch": "^4.0.0", | ||
"intl-messageformat": "^10.5.14", | ||
"md5": "^2.3.0" | ||
} | ||
} |
/* eslint-disable class-methods-use-this */ | ||
import MessageFormat from '@messageformat/core'; | ||
import IntlMessageFormat from 'intl-messageformat'; | ||
// object to cache MessageFormat classes related to | ||
// specific locales | ||
const MF = {}; | ||
/** | ||
@@ -19,16 +15,10 @@ * MessageFormat renderer | ||
const locale = ((localeCode || '').split('_'))[0]; | ||
if (!MF[locale]) { | ||
try { | ||
MF[locale] = new MessageFormat(locale, { | ||
strictPluralKeys: false, | ||
}); | ||
} catch (err) { | ||
MF[locale] = new MessageFormat('*', { | ||
strictPluralKeys: false, | ||
}); | ||
} | ||
let msg; | ||
try { | ||
msg = new IntlMessageFormat(sourceString, locale, undefined, { ignoreTag: true }); | ||
} catch (err) { | ||
msg = new IntlMessageFormat(sourceString, undefined, undefined, { ignoreTag: true }); | ||
} | ||
const msg = MF[locale].compile(sourceString); | ||
return msg(params); | ||
return msg.format(params); | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
7
1229872
3161
+ Addedintl-messageformat@^10.5.14
+ Added@formatjs/ecma402-abstract@2.3.1(transitive)
+ Added@formatjs/fast-memoize@2.2.5(transitive)
+ Added@formatjs/icu-messageformat-parser@2.9.7(transitive)
+ Added@formatjs/icu-skeleton-parser@1.8.11(transitive)
+ Added@formatjs/intl-localematcher@0.5.9(transitive)
+ Addeddecimal.js@10.4.3(transitive)
+ Addedintl-messageformat@10.7.10(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@messageformat/core@^3.3.0
- Removed@messageformat/core@3.4.0(transitive)
- Removed@messageformat/date-skeleton@1.1.0(transitive)
- Removed@messageformat/number-skeleton@1.2.0(transitive)
- Removed@messageformat/parser@5.1.0(transitive)
- Removed@messageformat/runtime@3.0.1(transitive)
- Removedmake-plural@7.4.0(transitive)
- Removedmoo@0.5.2(transitive)
- Removedsafe-identifier@0.4.2(transitive)