MCPcopy
hub / github.com/QwikDev/partytown / serial

Function serial

tests/integrations/hubspot/shell.js:7893–7923  ·  view source on GitHub ↗
(e, t)

Source from the content-addressed store, hash-verified

7891 return e ? e.replace(/\r?\n/g, '\r\n') : '';
7892 }
7893 function serial(e, t) {
7894 var n,
7895 i,
7896 a,
7897 r,
7898 o = e.name,
7899 s = e.tagName.toLowerCase(),
7900 l = function (e) {
7901 e &&
7902 !e.disabled &&
7903 t(o, normalize(e.attributes.value && e.attributes.value.specified ? e.value : e.text));
7904 };
7905 if (!e.disabled && o)
7906 switch (s) {
7907 case 'input':
7908 if (!/reset|button|image|file/i.test(e.type)) {
7909 n = /checkbox/i.test(e.type);
7910 i = /radio/i.test(e.type);
7911 a = e.value;
7912 ((!n && !i) || e.checked) && t(o, normalize(n && '' === a ? 'on' : a));
7913 }
7914 break;
7915 case 'textarea':
7916 t(o, normalize(e.value));
7917 break;
7918 case 'select':
7919 if ('select-one' === e.type.toLowerCase())
7920 l(e.selectedIndex >= 0 ? e.options[e.selectedIndex] : null);
7921 else for (r = 0; e.length && r < e.length; r++) e.options[r].selected && l(e.options[r]);
7922 }
7923 }
7924 function eachFormElement() {
7925 var e,
7926 t,

Callers 2

iFunction · 0.70
eachFormElementFunction · 0.70

Calls 3

tFunction · 0.70
normalizeFunction · 0.70
lFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…