MCPcopy Index your code
hub / github.com/messageformat/messageformat / L

Function L

docs/scripts/prettify/prettify.js:4–81  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

2window.PR_SHOULD_USE_CONTINUATION = !0;
3(function() {
4 function L(a) {
5 function m(a) {
6 var f = a.charCodeAt(0);
7 if (f !== 92) return f;
8 var b = a.charAt(1);
9 return (f = r[b]) ? f : "0" <= b && b <= "7" ? parseInt(a.substring(1), 8) : b === "u" || b === "x" ? parseInt(a.substring(2), 16) : a.charCodeAt(1)
10 }
11
12 function e(a) {
13 if (a < 32) return (a < 16 ? "\\x0" : "\\x") + a.toString(16);
14 a = String.fromCharCode(a);
15 if (a === "\\" || a === "-" || a === "[" || a === "]") a = "\\" + a;
16 return a
17 }
18
19 function h(a) {
20 for (var f = a.substring(1, a.length - 1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g), a = [], b = [], o = f[0] === "^", c = o ? 1 : 0, i = f.length; c < i; ++c) {
21 var j = f[c];
22 if (/\\[bdsw]/i.test(j)) a.push(j);
23 else {
24 var j = m(j),
25 d;
26 c + 2 < i && "-" === f[c + 1] ? (d = m(f[c + 2]), c += 2) : d = j;
27 b.push([j, d]);
28 d < 65 || j > 122 || (d < 65 || j > 90 || b.push([Math.max(65, j) | 32, Math.min(d, 90) | 32]), d < 97 || j > 122 || b.push([Math.max(97, j) & -33, Math.min(d, 122) & -33]))
29 }
30 }
31 b.sort(function(a, f) {
32 return a[0] - f[0] || f[1] - a[1]
33 });
34 f = [];
35 j = [NaN, NaN];
36 for (c = 0; c < b.length; ++c) i = b[c], i[0] <= j[1] + 1 ? j[1] = Math.max(j[1], i[1]) : f.push(j = i);
37 b = ["["];
38 o && b.push("^");
39 b.push.apply(b, a);
40 for (c = 0; c < f.length; ++c) i = f[c], b.push(e(i[0])), i[1] > i[0] && (i[1] + 1 > i[0] && b.push("-"), b.push(e(i[1])));
41 b.push("]");
42 return b.join("")
43 }
44
45 function y(a) {
46 for (var f = a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g), b = f.length, d = [], c = 0, i = 0; c < b; ++c) {
47 var j = f[c];
48 j === "(" ? ++i : "\\" === j.charAt(0) && (j = +j.substring(1)) && j <= i && (d[j] = -1)
49 }
50 for (c = 1; c < d.length; ++c) - 1 === d[c] && (d[c] = ++t);
51 for (i = c = 0; c < b; ++c) j = f[c], j === "(" ? (++i, d[i] === void 0 && (f[c] = "(?:")) : "\\" === j.charAt(0) && (j = +j.substring(1)) && j <= i && (f[c] = "\\" + d[i]);
52 for (i = c = 0; c < b; ++c)"^" === f[c] && "^" !== f[c + 1] && (f[c] = "");
53 if (a.ignoreCase && s) for (c = 0; c < b; ++c) j = f[c], a = j.charAt(0), j.length >= 2 && a === "[" ? f[c] = h(j) : a !== "\\" && (f[c] = j.replace(/[A-Za-z]/g, function(a) {
54 a = a.charCodeAt(0);
55 return "[" + String.fromCharCode(a & -33, a | 32) + "]"
56 }));
57 return f.join("")
58 }
59 for (var t = 0, s = !1, l = !1, p = 0, d = a.length; p < d; ++p) {
60 var g = a[p];
61 if (g.ignoreCase) l = !0;

Callers 1

xFunction · 0.70

Calls 1

yFunction · 0.70

Tested by

no test coverage detected