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

Function shouldRemoveAttribute

code/redux/public/app.js:4340–4360  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

4338}
4339
4340function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
4341 if (value === null || typeof value === 'undefined') {
4342 return true;
4343 }
4344 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
4345 return true;
4346 }
4347 if (propertyInfo !== null) {
4348 switch (propertyInfo.type) {
4349 case BOOLEAN:
4350 return !value;
4351 case OVERLOADED_BOOLEAN:
4352 return value === false;
4353 case NUMERIC:
4354 return isNaN(value);
4355 case POSITIVE_NUMERIC:
4356 return isNaN(value) || value < 1;
4357 }
4358 }
4359 return false;
4360}
4361
4362function getPropertyInfo(name) {
4363 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