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

Function isAttributeNameSafe

code/new-context-api/public/app.js:3392–3408  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

3390var validatedAttributeNameCache = {};
3391
3392function isAttributeNameSafe(attributeName) {
3393 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
3394 return true;
3395 }
3396 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
3397 return false;
3398 }
3399 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
3400 validatedAttributeNameCache[attributeName] = true;
3401 return true;
3402 }
3403 illegalAttributeNameCache[attributeName] = true;
3404 {
3405 warning(false, 'Invalid attribute name: `%s`', attributeName);
3406 }
3407 return false;
3408}
3409
3410function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
3411 if (propertyInfo !== null) {

Callers 2

getValueForAttributeFunction · 0.70
setValueForPropertyFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected