MCPcopy Create free account
hub / github.com/microsoft/SandDance / getKeyForRules

Function getKeyForRules

docs/app/js/sanddance-app.js:22078–22093  ·  view source on GitHub ↗
(options, rules)

Source from the content-addressed store, hash-verified

22076 currentRules[name + "Left"] = parts[3] || parts[1] || parts[0];
22077}
22078function getKeyForRules(options, rules) {
22079 var serialized = [
22080 options.rtl ? "rtl" : "ltr"
22081 ];
22082 var hasProps = false;
22083 for(var _i = 0, _a = rules.__order; _i < _a.length; _i++){
22084 var selector = _a[_i];
22085 serialized.push(selector);
22086 var rulesForSelector = rules[selector];
22087 for(var propName in rulesForSelector)if (rulesForSelector.hasOwnProperty(propName) && rulesForSelector[propName] !== undefined) {
22088 hasProps = true;
22089 serialized.push(propName, rulesForSelector[propName]);
22090 }
22091 }
22092 return hasProps ? serialized.join("") : undefined;
22093}
22094function repeatString(target, count) {
22095 if (count <= 0) return "";
22096 if (count === 1) return target;

Callers 1

styleToRegistrationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected