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

Function shouldRemoveAttribute

code/styling/public/app.js:4089–4109  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

4087}
4088
4089function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
4090 if (value === null || typeof value === 'undefined') {
4091 return true;
4092 }
4093 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
4094 return true;
4095 }
4096 if (propertyInfo !== null) {
4097 switch (propertyInfo.type) {
4098 case BOOLEAN:
4099 return !value;
4100 case OVERLOADED_BOOLEAN:
4101 return value === false;
4102 case NUMERIC:
4103 return isNaN(value);
4104 case POSITIVE_NUMERIC:
4105 return isNaN(value) || value < 1;
4106 }
4107 }
4108 return false;
4109}
4110
4111function getPropertyInfo(name) {
4112 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