MCPcopy
hub / github.com/csscomb/csscomb.js / updateDict

Function updateDict

src/options/vendor-prefix-align.js:222–237  ·  view source on GitHub ↗

* Updates dict which contains info about items align. * * @param {Object} info * @param {Object} dict

(info, dict)

Source from the content-addressed store, hash-verified

220 * @param {Object} dict
221 */
222 function updateDict(info, dict) {
223 if (info.prefixLength === 0 && info.extra === 0) return;
224
225 var indent = dict[info.id] || {prefixLength: 0, extra: 0};
226
227 let indentLength = indent.prefixLength + indent.extra;
228 let infoLength = info.prefixLength + info.extra;
229 if (indentLength > infoLength) {
230 dict[info.id] = indent;
231 } else {
232 dict[info.id] = {
233 prefixLength: info.prefixLength,
234 extra: info.extra
235 };
236 }
237 }
238
239 /**
240 * Returns string with correct number of spaces for info.baseName property.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected