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

Function getPrefixInfo

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

* Creates object which contains info about vendor prefix used * in propertyName. * * @param {String} propertyName property name * @param {String} [namespace=''] namespace name * @param {Number} [extraSymbols=0] extra symbols count * @returns {Object|undefined}

(propertyName, namespace, extraSymbols)

Source from the content-addressed store, hash-verified

35 * @returns {Object|undefined}
36 */
37 function getPrefixInfo(propertyName, namespace, extraSymbols) {
38 var baseName = propertyName;
39 var prefixLength = 0;
40
41 namespace = namespace || '';
42 extraSymbols = extraSymbols || 0;
43
44 if (!propertyName) return;
45
46 PREFIXES.some(function(prefix) {
47 prefix = '-' + prefix + '-';
48 if (propertyName.indexOf(prefix) !== 0) return;
49
50 baseName = baseName.substr(prefix.length);
51 prefixLength = prefix.length;
52
53 return true;
54 });
55
56 return {
57 id: namespace + baseName,
58 baseName: baseName,
59 prefixLength: prefixLength,
60 extra: extraSymbols
61 };
62 }
63
64 /**
65 * Returns extra indent for item in arguments

Callers 2

makeNamespaceFunction · 0.85
walkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected