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

Function shouldRemoveAttribute

code/composition/public/app.js:4227–4247  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

4225}
4226
4227function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
4228 if (value === null || typeof value === 'undefined') {
4229 return true;
4230 }
4231 if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
4232 return true;
4233 }
4234 if (propertyInfo !== null) {
4235 switch (propertyInfo.type) {
4236 case BOOLEAN:
4237 return !value;
4238 case OVERLOADED_BOOLEAN:
4239 return value === false;
4240 case NUMERIC:
4241 return isNaN(value);
4242 case POSITIVE_NUMERIC:
4243 return isNaN(value) || value < 1;
4244 }
4245 }
4246 return false;
4247}
4248
4249function getPropertyInfo(name) {
4250 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