MCPcopy Index your code
hub / github.com/microsoft/SandDance / shouldRemoveAttribute

Function shouldRemoveAttribute

docs/external/js/react-dom.development.js:965–995  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

963 }
964 }
965 function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
966 if (value === null || typeof value === 'undefined') {
967 return true;
968 }
969
970 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
971 return true;
972 }
973
974 if (isCustomComponentTag) {
975 return false;
976 }
977
978 if (propertyInfo !== null) {
979 switch (propertyInfo.type) {
980 case BOOLEAN:
981 return !value;
982
983 case OVERLOADED_BOOLEAN:
984 return value === false;
985
986 case NUMERIC:
987 return isNaN(value);
988
989 case POSITIVE_NUMERIC:
990 return isNaN(value) || value < 1;
991 }
992 }
993
994 return false;
995 }
996 function getPropertyInfo(name) {
997 return properties.hasOwnProperty(name) ? properties[name] : null;
998 }

Callers 3

getValueForPropertyFunction · 0.85
setValueForPropertyFunction · 0.85
diffHydratedPropertiesFunction · 0.85

Calls 1

Tested by

no test coverage detected