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

Function isAttributeNameSafe

code/styling/public/app.js:4031–4047  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

4029var validatedAttributeNameCache = {};
4030
4031function isAttributeNameSafe(attributeName) {
4032 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
4033 return true;
4034 }
4035 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
4036 return false;
4037 }
4038 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
4039 validatedAttributeNameCache[attributeName] = true;
4040 return true;
4041 }
4042 illegalAttributeNameCache[attributeName] = true;
4043 {
4044 warning(false, 'Invalid attribute name: `%s`', attributeName);
4045 }
4046 return false;
4047}
4048
4049function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
4050 if (propertyInfo !== null) {

Callers 2

getValueForAttributeFunction · 0.70
setValueForPropertyFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected