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

Function shouldRemoveAttribute

code/event-handlers/public/app.js:3419–3439  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

3417}
3418
3419function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
3420 if (value === null || typeof value === 'undefined') {
3421 return true;
3422 }
3423 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
3424 return true;
3425 }
3426 if (propertyInfo !== null) {
3427 switch (propertyInfo.type) {
3428 case BOOLEAN:
3429 return !value;
3430 case OVERLOADED_BOOLEAN:
3431 return value === false;
3432 case NUMERIC:
3433 return isNaN(value);
3434 case POSITIVE_NUMERIC:
3435 return isNaN(value) || value < 1;
3436 }
3437 }
3438 return false;
3439}
3440
3441function getPropertyInfo(name) {
3442 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