Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function resolveLocale(locales) {
// IntlMessageFormat#_resolveLocale() does not depend on `this`.
return IntlMessageFormat.prototype._resolveLocale(locales);
}
function findPluralFunction(locale) {
// IntlMessageFormat#_findPluralFunction() does not depend on `this`.
return IntlMessageFormat.prototype._findPluralRuleFunction(locale);
}
* hornet-js-utils - Partie commune et utilitaire à tous les composants hornet-js
*
* @author MEAE - Ministère de l'Europe et des Affaires étrangères
* @version v5.4.1
* @link git+https://github.com/diplomatiegouvfr/hornet-js.git
* @license CECILL-2.1
*/
import { Utils } from "src/index";
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// patch intl-messageformat afin de ne pas échouer si un paramètre est manquant //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
const src$utils$$ = require("intl-messageformat/lib/utils");
const IntlMessageFormat = require("intl-messageformat");
IntlMessageFormat.prototype._format = function (pattern, values) {
let result = "";
let i;
let len;
let part;
let id;
let value;
for (i = 0, len = pattern.length; i < len; i += 1) {
part = pattern[ i ];
// Exist early for string parts.
if (typeof part === "string") {
result += part;
continue;
}