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

Function shouldRemoveAttribute

code/third-party/public/app.js:3322–3342  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

3320}
3321
3322function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
3323 if (value === null || typeof value === 'undefined') {
3324 return true;
3325 }
3326 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
3327 return true;
3328 }
3329 if (propertyInfo !== null) {
3330 switch (propertyInfo.type) {
3331 case BOOLEAN:
3332 return !value;
3333 case OVERLOADED_BOOLEAN:
3334 return value === false;
3335 case NUMERIC:
3336 return isNaN(value);
3337 case POSITIVE_NUMERIC:
3338 return isNaN(value) || value < 1;
3339 }
3340 }
3341 return false;
3342}
3343
3344function getPropertyInfo(name) {
3345 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