Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.prod.util.formatMessage.js.map Maven / Gradle / Ivy
{
"version": 3,
"sources": ["../../../src/util/formatMessage.ts"],
"sourcesContent": ["const messageFormatRegEX = /('')|'([^']+(?:''[^']*)*)(?:'|$)|\\{([0-9]+(?:\\s*,[^{}]*)?)\\}|[{}]/g;\n\nconst formatMessage = (text: string, values: Array) => {\n\tvalues = values || [];\n\n\treturn text.replace(messageFormatRegEX, ($0, $1, $2, $3: string | number, offset: number) => {\n\t\tif ($1) {\n\t\t\treturn '\\''; /* eslint-disable-line */\n\t\t}\n\n\t\tif ($2) {\n\t\t\treturn $2.replace(/''/g, '\\''); /* eslint-disable-line */\n\t\t}\n\n\t\tif ($3) {\n\t\t\tconst ind = typeof $3 === \"string\" ? parseInt($3) : $3;\n\t\t\treturn String(values[ind]);\n\t\t}\n\n\t\tthrow new Error(`[i18n]: pattern syntax error at pos ${offset}`);\n\t});\n};\n\nexport default formatMessage;\n"],
"mappings": "aAAA,MAAMA,EAAqB,qEAErBC,EAAgB,CAACC,EAAcC,KACpCA,EAASA,GAAU,CAAC,EAEbD,EAAK,QAAQF,EAAoB,CAACI,EAAIC,EAAIC,EAAIC,EAAqBC,IAAmB,CAC5F,GAAIH,EACH,MAAO,IAGR,GAAIC,EACH,OAAOA,EAAG,QAAQ,MAAO,GAAI,EAG9B,GAAIC,EAAI,CACP,MAAME,EAAM,OAAOF,GAAO,SAAW,SAASA,CAAE,EAAIA,EACpD,OAAO,OAAOJ,EAAOM,CAAG,CAAC,CAC1B,CAEA,MAAM,IAAI,MAAM,uCAAuCD,CAAM,EAAE,CAChE,CAAC,GAGF,eAAeP",
"names": ["messageFormatRegEX", "formatMessage", "text", "values", "$0", "$1", "$2", "$3", "offset", "ind"]
}