* Generate a key string that identifies a component within a set. * * @param {*} component A component that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string}
(component, index)
| 2108 | * @return {string} |
| 2109 | */ |
| 2110 | function getComponentKey(component, index) { |
| 2111 | // Do some typechecking here since we call this blindly. We want to ensure |
| 2112 | // that we don't block potential future ES APIs. |
| 2113 | if ((typeof component === 'undefined' ? 'undefined' : _typeof(component)) === 'object' && component !== null && component.key != null) { |
| 2114 | // Explicit key |
| 2115 | return escape(component.key); |
| 2116 | } |
| 2117 | // Implicit key determined by the index in the set |
| 2118 | return index.toString(36); |
| 2119 | } |
| 2120 | |
| 2121 | function forEachSingleChild(bookKeeping, child, name) { |
| 2122 | var func = bookKeeping.func, |
no test coverage detected