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

Function isAttributeNameSafe

code/composition/public/app.js:4169–4185  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

4167var validatedAttributeNameCache = {};
4168
4169function isAttributeNameSafe(attributeName) {
4170 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
4171 return true;
4172 }
4173 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
4174 return false;
4175 }
4176 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
4177 validatedAttributeNameCache[attributeName] = true;
4178 return true;
4179 }
4180 illegalAttributeNameCache[attributeName] = true;
4181 {
4182 warning(false, 'Invalid attribute name: `%s`', attributeName);
4183 }
4184 return false;
4185}
4186
4187function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
4188 if (propertyInfo !== null) {

Callers 2

getValueForAttributeFunction · 0.70
setValueForPropertyFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected