MCPcopy
hub / github.com/css/csso / addSelectors

Function addSelectors

lib/restructure/utils.js:75–98  ·  view source on GitHub ↗
(dest, source)

Source from the content-addressed store, hash-verified

73}
74
75export function addSelectors(dest, source) {
76 source.forEach((sourceData) => {
77 const newStr = sourceData.id;
78 let cursor = dest.head;
79
80 while (cursor) {
81 const nextStr = cursor.data.id;
82
83 if (nextStr === newStr) {
84 return;
85 }
86
87 if (nextStr > newStr) {
88 break;
89 }
90
91 cursor = cursor.next;
92 }
93
94 dest.insert(dest.createItem(sourceData), cursor);
95 });
96
97 return dest;
98}
99
100// check if simpleselectors has no equal specificity and element selector
101export function hasSimilarSelectors(selectors1, selectors2) {

Callers 2

processRuleFunction · 0.90
processRuleFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…