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

Function shouldRemoveAttribute

code/new-context-api/public/app.js:3450–3470  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

3448}
3449
3450function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
3451 if (value === null || typeof value === 'undefined') {
3452 return true;
3453 }
3454 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
3455 return true;
3456 }
3457 if (propertyInfo !== null) {
3458 switch (propertyInfo.type) {
3459 case BOOLEAN:
3460 return !value;
3461 case OVERLOADED_BOOLEAN:
3462 return value === false;
3463 case NUMERIC:
3464 return isNaN(value);
3465 case POSITIVE_NUMERIC:
3466 return isNaN(value) || value < 1;
3467 }
3468 }
3469 return false;
3470}
3471
3472function getPropertyInfo(name) {
3473 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