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.PropertiesFileFormat.js.map Maven / Gradle / Ivy
{
"version": 3,
"sources": ["../../src/PropertiesFileFormat.ts"],
"sourcesContent": ["const flatstr = typeof window.chrome === \"object\" || typeof window.v8 === \"object\" ? (s: string, iConcatOps: number) => {\n\tif (iConcatOps > 2 && 40 * iConcatOps > s.length) {\n\t\tNumber(s);\n\t}\n\treturn s;\n} : (s: string) => s;\n\nconst rLines = /(?:\\r\\n|\\r|\\n|^)[ \\t\\f]*/;\nconst rEscapesOrSeparator = /(\\\\u[0-9a-fA-F]{0,4})|(\\\\.)|(\\\\$)|([ \\t\\f]*[ \\t\\f:=][ \\t\\f]*)/g;\nconst rEscapes = /(\\\\u[0-9a-fA-F]{0,4})|(\\\\.)|(\\\\$)/g;\nconst mEscapes = {\n\t\"\\\\f\": \"\\f\",\n\t\"\\\\n\": \"\\n\",\n\t\"\\\\r\": \"\\r\",\n\t\"\\\\t\": \"\\t\",\n};\n\n/**\n * Parses a .properties format\n * @param {string} sText the contents a of a .properties file\n * @returns a object with key/value pairs parsed from the .properties file format\n * @public\n */\nconst parseProperties = (sText: string) => {\n\tconst properties = {},\n\t\taLines = sText.split(rLines);\n\n\tlet sLine,\n\t\trMatcher,\n\t\tsKey,\n\t\tsValue: string,\n\t\ti,\n\t\tm,\n\t\tiLastIndex,\n\t\tiConcatOps: number;\n\n\tconst append = (s: string) => {\n\t\tif (sValue) {\n\t\t\tsValue = `${sValue}${s}`;\n\t\t\tiConcatOps++;\n\t\t} else {\n\t\t\tsValue = s;\n\t\t\tiConcatOps = 0;\n\t\t}\n\t};\n\n\tfor (i = 0; i < aLines.length; i++) {\n\t\tsLine = aLines[i];\n\t\tconst skipLine = sLine === \"\" || sLine.charAt(0) === \"#\" || sLine.charAt(0) === \"!\";\n\n\t\tif (!skipLine) {\n\t\t\trMatcher = rEscapesOrSeparator;\n\t\t\tiLastIndex = 0;\n\t\t\trMatcher.lastIndex = iLastIndex;\n\t\t\tsKey = null;\n\t\t\tsValue = \"\";\n\t\t\tm = rMatcher.exec(sLine);\n\t\t\twhile (m !== null) {\n\t\t\t\tif (iLastIndex < m.index) {\n\t\t\t\t\tappend(sLine.slice(iLastIndex, m.index));\n\t\t\t\t}\n\t\t\t\tiLastIndex = rMatcher.lastIndex;\n\t\t\t\tif (m[1]) {\n\t\t\t\t\tif (m[1].length !== 6) {\n\t\t\t\t\t\tthrow new Error(`Incomplete Unicode Escape '${m[1]}'`);\n\t\t\t\t\t}\n\t\t\t\t\tappend(String.fromCharCode(parseInt(m[1].slice(2), 16)));\n\t\t\t\t} else if (m[2]) {\n\t\t\t\t\tappend(mEscapes[m[2] as keyof typeof mEscapes] || m[2].slice(1));\n\t\t\t\t} else if (m[3]) {\n\t\t\t\t\tsLine = aLines[++i];\n\t\t\t\t\tiLastIndex = 0;\n\t\t\t\t\trMatcher.lastIndex = iLastIndex;\n\t\t\t\t} else if (m[4]) {\n\t\t\t\t\tsKey = sValue;\n\t\t\t\t\tsValue = \"\";\n\t\t\t\t\trMatcher = rEscapes;\n\t\t\t\t\trMatcher.lastIndex = iLastIndex;\n\t\t\t\t}\n\t\t\t\tm = rMatcher.exec(sLine);\n\t\t\t}\n\t\t\tif (iLastIndex < sLine.length) {\n\t\t\t\tappend(sLine.slice(iLastIndex));\n\t\t\t}\n\t\t\tif (sKey == null) {\n\t\t\t\tsKey = sValue;\n\t\t\t\tsValue = \"\";\n\t\t\t}\n\t\t\t(properties as Record)[sKey] = flatstr(sValue, sValue ? iConcatOps! : 0);\n\t\t}\n\t}\n\treturn properties;\n};\n\nexport default parseProperties;\n"],
"mappings": "aAAA,MAAMA,EAAU,OAAO,OAAO,QAAW,UAAY,OAAO,OAAO,IAAO,SAAW,CAACC,EAAWC,KAC5FA,EAAa,GAAK,GAAKA,EAAaD,EAAE,QACzC,OAAOA,CAAC,EAEFA,GACHA,G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,EAAS,UAAYK,GAEtBD,EAAIJ,EAAS,KAAKD,CAAK,CACxB,CACIM,EAAaN,EAAM,QACtBO,EAAOP,EAAM,MAAMM,CAAU,CAAC,EAE3BJ,GAAQ,OACXA,EAAOC,EACPA,EAAS,IAETL,EAAmCI,CAAI,EAAIb,EAAQc,EAAQA,EAASZ,EAAc,CAAC,CACrF,CAED,OAAOO,CACR,EAEA,eAAeF",
"names": ["flatstr", "s", "iConcatOps", "rLines", "rEscapesOrSeparator", "rEscapes", "mEscapes", "parseProperties", "sText", "properties", "aLines", "sLine", "rMatcher", "sKey", "sValue", "i", "m", "iLastIndex", "append"]
}