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.PropertiesFileFormat.js.map Maven / Gradle / Ivy
{"version":3,"file":"PropertiesFileFormat.js","sourceRoot":"","sources":["../src/PropertiesFileFormat.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAS,EAAE,UAAkB,EAAE,EAAE;IACtH,IAAI,UAAU,GAAG,CAAC,IAAI,EAAE,GAAG,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE;QACjD,MAAM,CAAC,CAAC,CAAC,CAAC;KACV;IACD,OAAO,CAAC,CAAC;AACV,CAAC,CAAC,CAAC,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC;AAErB,MAAM,MAAM,GAAG,0BAA0B,CAAC;AAC1C,MAAM,mBAAmB,GAAG,gEAAgE,CAAC;AAC7F,MAAM,QAAQ,GAAG,oCAAoC,CAAC;AACtD,MAAM,QAAQ,GAAG;IAChB,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACX,CAAC;AAEF;;;;;GAKG;AACH,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,EAAE,EACpB,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE9B,IAAI,KAAK,EACR,QAAQ,EACR,IAAI,EACJ,MAAc,EACd,CAAC,EACD,CAAC,EACD,UAAU,EACV,UAAkB,CAAC;IAEpB,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE;QAC5B,IAAI,MAAM,EAAE;YACX,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC;YACz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CAAC;iBACzD;qBAAM,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;oBAChB,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;iBACjE;qBAAM,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;oBAChB,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;oBACpB,UAAU,GAAG,CAAC,CAAC;oBACf,QAAQ,CAAC,SAAS,GAAG,UAAU,CAAC;iBAChC;qBAAM,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;oBAChB,IAAI,GAAG,MAAM,CAAC;oBACd,MAAM,GAAG,EAAE,CAAC;oBACZ,QAAQ,GAAG,QAAQ,CAAC;oBACpB,QAAQ,CAAC,SAAS,GAAG,UAAU,CAAC;iBAChC;gBACD,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACzB;YACD,IAAI,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE;gBAC9B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;aAChC;YACD,IAAI,IAAI,IAAI,IAAI,EAAE;gBACjB,IAAI,GAAG,MAAM,CAAC;gBACd,MAAM,GAAG,EAAE,CAAC;aACZ;YACA,UAAkC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACtF;KACD;IACD,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","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"]}