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

Function shouldRemoveAttribute

code/dependency-injection/public/app.js:4182–4202  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

4180}
4181
4182function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
4183 if (value === null || typeof value === 'undefined') {
4184 return true;
4185 }
4186 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
4187 return true;
4188 }
4189 if (propertyInfo !== null) {
4190 switch (propertyInfo.type) {
4191 case BOOLEAN:
4192 return !value;
4193 case OVERLOADED_BOOLEAN:
4194 return value === false;
4195 case NUMERIC:
4196 return isNaN(value);
4197 case POSITIVE_NUMERIC:
4198 return isNaN(value) || value < 1;
4199 }
4200 }
4201 return false;
4202}
4203
4204function getPropertyInfo(name) {
4205 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