MCPcopy Create free account
hub / github.com/caseywebdev/react-list / isAttributeNameSafe

Function isAttributeNameSafe

docs/index.js:4411–4419  ·  view source on GitHub ↗
(attributeName)

Source from the content-addressed store, hash-verified

4409 illegalAttributeNameCache = {},
4410 validatedAttributeNameCache = {};
4411function isAttributeNameSafe(attributeName) {
4412 if (hasOwnProperty.call(validatedAttributeNameCache, attributeName))
4413 return !0;
4414 if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) return !1;
4415 if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName))
4416 return (validatedAttributeNameCache[attributeName] = !0);
4417 illegalAttributeNameCache[attributeName] = !0;
4418 return !1;
4419}
4420function setValueForAttribute(node, name, value) {
4421 if (isAttributeNameSafe(name))
4422 if (null === value) node.removeAttribute(name);

Callers 3

setValueForAttributeFunction · 0.85
diffHydratedPropertiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…