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

Function isAttributeNameSafe

code/dependency-injection/public/app.js:4124–4140  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

4122var validatedAttributeNameCache = {};
4123
4124function isAttributeNameSafe(attributeName) {
4125 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
4126 return true;
4127 }
4128 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
4129 return false;
4130 }
4131 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
4132 validatedAttributeNameCache[attributeName] = true;
4133 return true;
4134 }
4135 illegalAttributeNameCache[attributeName] = true;
4136 {
4137 warning(false, 'Invalid attribute name: `%s`', attributeName);
4138 }
4139 return false;
4140}
4141
4142function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
4143 if (propertyInfo !== null) {

Callers 2

getValueForAttributeFunction · 0.70
setValueForPropertyFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected