Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (className && !!val) {
return className;
} else if (falsyClassName && !val) {
return falsyClassName;
} else {
return null;
}
// If value is a Boolean and true, return the dasherized property
// name.
} else if (val === true) {
// Normalize property path to be suitable for use
// as a class name. For exaple, content.foo.barBaz
// becomes bar-baz.
let parts = path.split('.');
return dasherize(parts[parts.length - 1]);
// If the value is not false, undefined, or null, return the current
// value of the property.
} else if (val !== false && val != null) {
return val;
// Nothing to display. Return null so that the old class is removed
// but no new class is added.
} else {
return null;
}
}
if (!!value) {
return activeClass;
} else {
return inactiveClass;
}
// If value is a Boolean and true, return the dasherized property
// name.
} else if (value === true) {
// Only apply to last segment in the path.
if (propName && isPath(propName)) {
let segments = propName.split('.');
propName = segments[segments.length - 1];
}
return dasherize(propName);
// If the value is not false, undefined, or null, return the current
// value of the property.
} else if (value !== false && value != null) {
return value;
// Nothing to display. Return null so that the old class is removed
// but no new class is added.
} else {
return null;
}
}