MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / shouldRemoveAttribute

Function shouldRemoveAttribute

code/communication/public/app.js:4124–4144  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

4122}
4123
4124function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
4125 if (value === null || typeof value === 'undefined') {
4126 return true;
4127 }
4128 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
4129 return true;
4130 }
4131 if (propertyInfo !== null) {
4132 switch (propertyInfo.type) {
4133 case BOOLEAN:
4134 return !value;
4135 case OVERLOADED_BOOLEAN:
4136 return value === false;
4137 case NUMERIC:
4138 return isNaN(value);
4139 case POSITIVE_NUMERIC:
4140 return isNaN(value) || value < 1;
4141 }
4142 }
4143 return false;
4144}
4145
4146function getPropertyInfo(name) {
4147 return properties.hasOwnProperty(name) ? properties[name] : null;

Callers 3

getValueForPropertyFunction · 0.70
setValueForPropertyFunction · 0.70
diffHydratedProperties$1Function · 0.70

Calls 1

Tested by

no test coverage detected