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

Function isAttributeNameSafe

code/third-party/public/app.js:3264–3280  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

3262var validatedAttributeNameCache = {};
3263
3264function isAttributeNameSafe(attributeName) {
3265 if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {
3266 return true;
3267 }
3268 if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {
3269 return false;
3270 }
3271 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
3272 validatedAttributeNameCache[attributeName] = true;
3273 return true;
3274 }
3275 illegalAttributeNameCache[attributeName] = true;
3276 {
3277 warning(false, 'Invalid attribute name: `%s`', attributeName);
3278 }
3279 return false;
3280}
3281
3282function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
3283 if (propertyInfo !== null) {

Callers 2

getValueForAttributeFunction · 0.70
setValueForPropertyFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected