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

Function isAttributeNameSafe

code/communication/public/app.js:4066–4082  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

4064var validatedAttributeNameCache = {};
4065
4066function isAttributeNameSafe(attributeName) {
4067 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
4068 return true;
4069 }
4070 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
4071 return false;
4072 }
4073 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
4074 validatedAttributeNameCache[attributeName] = true;
4075 return true;
4076 }
4077 illegalAttributeNameCache[attributeName] = true;
4078 {
4079 warning(false, 'Invalid attribute name: `%s`', attributeName);
4080 }
4081 return false;
4082}
4083
4084function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
4085 if (propertyInfo !== null) {

Callers 2

getValueForAttributeFunction · 0.70
setValueForPropertyFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected