Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function extendStyle(style: Object, extension: Object): void {
// extend conditional style objects
if (
extension &&
Object.prototype.hasOwnProperty.call(extension, 'condition')
) {
if (extension.condition) {
// eslint-disable-next-line no-use-before-define
assignStyle(style, extend(extension.style))
}
} else {
// extend basic style objects
assignStyle(style, removeUndefined(extension))
}
}
function extendStyle(style, extension, extendPlugin) {
// extend conditional style objects
if (extension.hasOwnProperty('condition')) {
if (extension.condition) {
assignStyle(style, extendPlugin(extension.style));
}
} else {
// extend basic style objects
assignStyle(style, extension);
}
}
function resolveNamedKeys(style: Object, keys: Object) {
for (const property in style) {
const value = style[property]
if (isPlainObject(value)) {
const resolvedValue = resolveNamedKeys(value, keys)
if (keys.hasOwnProperty(property)) {
const resolvedKey = keys[property]
if (style.hasOwnProperty(resolvedKey)) {
style[resolvedKey] = assignStyle(style[resolvedKey], resolvedValue)
} else {
style[resolvedKey] = resolvedValue
}
// We clean the old keys as they're not used anymore
delete style[property]
}
}
}
return style
}
function extendStyle(style: Object, extension: Object): void {
// extend conditional style objects
if (
extension &&
Object.prototype.hasOwnProperty.call(extension, 'condition')
) {
if (extension.condition) {
// eslint-disable-next-line no-use-before-define
assignStyle(style, extend(extension.style))
}
} else {
// extend basic style objects
assignStyle(style, removeUndefined(extension))
}
}
function extendStyle(style, extension, extendPlugin) {
// extend conditional style objects
if (extension.hasOwnProperty('condition')) {
if (extension.condition) {
assignStyle(style, extendPlugin(extension.style));
}
} else {
// extend basic style objects
assignStyle(style, extension);
}
}
function resolveCustomProperty(style, properties) {
for (var property in style) {
var value = style[property];
if (properties.hasOwnProperty(property)) {
assignStyle(style, properties[property](value));
delete style[property];
}
if (isObject(value)) {
style[property] = resolveCustomProperty(value, properties);
}
}
return style;
}
function resolveCustomProperty(style, properties) {
for (var property in style) {
var value = style[property];
if (properties.hasOwnProperty(property)) {
assignStyle(style, properties[property](value));
delete style[property];
}
if (isObject(value)) {
style[property] = resolveCustomProperty(value, properties);
}
}
return style;
}