MCPcopy Create free account
hub / github.com/Lobos/react-ui / isAttributeNameSafe

Function isAttributeNameSafe

docs/lib/react.js:1731–1745  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

1729var validatedAttributeNameCache = {};
1730
1731function isAttributeNameSafe(attributeName) {
1732 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
1733 return true;
1734 }
1735 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
1736 return false;
1737 }
1738 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
1739 validatedAttributeNameCache[attributeName] = true;
1740 return true;
1741 }
1742 illegalAttributeNameCache[attributeName] = true;
1743 "development" !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;
1744 return false;
1745}
1746
1747function shouldIgnoreValue(propertyInfo, value) {
1748 return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;

Callers 1

react.jsFile · 0.85

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…