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

Function isAttributeNameSafe

code/redux/public/app.js:4282–4298  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

4280var validatedAttributeNameCache = {};
4281
4282function isAttributeNameSafe(attributeName) {
4283 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
4284 return true;
4285 }
4286 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
4287 return false;
4288 }
4289 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
4290 validatedAttributeNameCache[attributeName] = true;
4291 return true;
4292 }
4293 illegalAttributeNameCache[attributeName] = true;
4294 {
4295 warning(false, 'Invalid attribute name: `%s`', attributeName);
4296 }
4297 return false;
4298}
4299
4300function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
4301 if (propertyInfo !== null) {

Callers 2

getValueForAttributeFunction · 0.70
setValueForPropertyFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected