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

Function getValueForAttributeOnCustomComponent

docs/index.js:20061–20080  ·  view source on GitHub ↗
(node, name, expected)

Source from the content-addressed store, hash-verified

20059 return !1;
20060 }
20061 function getValueForAttributeOnCustomComponent(node, name, expected) {
20062 if (isAttributeNameSafe(name)) {
20063 if (!node.hasAttribute(name)) {
20064 switch (typeof expected) {
20065 case "symbol":
20066 case "object":
20067 return expected;
20068 case "function":
20069 return expected;
20070 case "boolean":
20071 if (!1 === expected) return expected;
20072 }
20073 return void 0 === expected ? void 0 : null;
20074 }
20075 node = node.getAttribute(name);
20076 if ("" === node && !0 === expected) return !0;
20077 checkAttributeStringCoercion(expected, name);
20078 return node === "" + expected ? expected : node;
20079 }
20080 }
20081 function setValueForAttribute(node, name, value) {
20082 if (isAttributeNameSafe(name))
20083 if (null === value) node.removeAttribute(name);

Callers 1

diffHydratedPropertiesFunction · 0.85

Calls 2

isAttributeNameSafeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…