* Generate a key string that identifies a element within a set. * * @param {*} element A element that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string}
(element, index)
| 990 | |
| 991 | |
| 992 | function getElementKey(element, index) { |
| 993 | // Do some typechecking here since we call this blindly. We want to ensure |
| 994 | // that we don't block potential future ES APIs. |
| 995 | if (typeof element === 'object' && element !== null && element.key != null) { |
| 996 | // Explicit key |
| 997 | { |
| 998 | checkKeyStringCoercion(element.key); |
| 999 | } |
| 1000 | |
| 1001 | return escape('' + element.key); |
| 1002 | } // Implicit key determined by the index in the set |
| 1003 | |
| 1004 | |
| 1005 | return index.toString(36); |
| 1006 | } |
| 1007 | |
| 1008 | function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { |
| 1009 | var type = typeof children; |
no test coverage detected
searching dependent graphs…