Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
{"version":3,"file":"isValidPropertyName.js","sourceRoot":"","sources":["../../src/util/isValidPropertyName.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,qEAAqE;AACrE,MAAM,SAAS,GAAG;IACjB,UAAU;IACV,OAAO;IACP,QAAQ;IACR,MAAM;IACN,WAAW;CACX,CAAC;AAEF;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5C,IAAI,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QACxD,OAAO,IAAI,CAAC;KACZ;IACD,MAAM,OAAO,GAAG;QACf,WAAW;QACX,OAAO;QACP,IAAI;KACJ,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,sBAAsB;AAC5F,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Note: disabled is present in IE so we explicitly allow it here.\n// Others, such as title/hidden, we explicitly override, so valid too\nconst allowList = [\n\t\"disabled\",\n\t\"title\",\n\t\"hidden\",\n\t\"role\",\n\t\"draggable\",\n];\n\n/**\n * Checks whether a property name is valid (does not collide with existing DOM API properties)\n *\n * @param name\n * @returns {boolean}\n */\nconst isValidPropertyName = (name: string) => {\n\tif (allowList.includes(name) || name.startsWith(\"aria\")) {\n\t\treturn true;\n\t}\n\tconst classes = [\n\t\tHTMLElement,\n\t\tElement,\n\t\tNode,\n\t];\n\treturn !classes.some(klass => klass.prototype.hasOwnProperty(name)); // eslint-disable-line\n};\n\nexport default isValidPropertyName;\n"]}