MCPcopy Create free account
hub / github.com/totaljs/framework / make_nested

Function make_nested

internal.js:2854–2908  ·  view source on GitHub ↗
(css, name)

Source from the content-addressed store, hash-verified

2852}
2853
2854function make_nested(css, name) {
2855
2856 var index = 0;
2857 var plus = '';
2858 var output = '';
2859 var count = 0;
2860 var A = false;
2861 var valid = false;
2862
2863 while (true) {
2864 var a = css[index++];
2865
2866 if (!a)
2867 break;
2868
2869 if (a === '\n' || a === '\r')
2870 continue;
2871
2872 if (a !== ' ' || plus[plus.length -1] !== ' ')
2873 plus += a;
2874
2875 if (a === '{') {
2876
2877 if (A) {
2878 count++;
2879 continue;
2880 }
2881
2882 A = true;
2883 count = 0;
2884 valid = false;
2885 continue;
2886 }
2887
2888 if (a === '}') {
2889
2890 if (count > 0) {
2891 count--;
2892 valid = true;
2893 continue;
2894 }
2895
2896 if (!valid) {
2897 output += name + ' ' + plus.trim();
2898 plus = '';
2899 A = false;
2900 continue;
2901 }
2902
2903 output += plus;
2904 }
2905 }
2906
2907 return output;
2908}
2909
2910function compressHTML(html, minify, isChunk) {
2911

Callers 1

process_nestedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected