All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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"]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy