File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
packages/react-property/src Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ var ATTRIBUTE_NAME_START_CHAR =
2+ ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD' ;
3+
4+ var ATTRIBUTE_NAME_CHAR =
5+ ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040' ;
6+
7+ /**
8+ * Checks whether a property name is a custom attribute.
9+ *
10+ * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L23-L25
11+ *
12+ * @param {String }
13+ * @return {Boolean }
14+ */
15+ var isCustomAttribute = RegExp . prototype . test . bind (
16+ new RegExp ( '^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$' )
17+ ) ;
18+
19+ module . exports = isCustomAttribute ;
You can’t perform that action at this time.
0 commit comments