(name, propDef)
| 33183 | |
| 33184 | |
| 33185 | function parsePropType(name, propDef) { |
| 33186 | switch (getTypeOf(propDef)) { |
| 33187 | case 'object': |
| 33188 | propDef = normalizePropType(name, propDef); |
| 33189 | return parsePropDefinition(propDef); |
| 33190 | |
| 33191 | case 'array': |
| 33192 | return guessArrayType(name, propDef); |
| 33193 | |
| 33194 | case 'boolean': |
| 33195 | return { |
| 33196 | name: name, |
| 33197 | type: 'boolean', |
| 33198 | value: propDef |
| 33199 | }; |
| 33200 | |
| 33201 | case 'number': |
| 33202 | return guessNumberType(name, propDef); |
| 33203 | |
| 33204 | case 'function': |
| 33205 | return { |
| 33206 | name: name, |
| 33207 | type: 'function', |
| 33208 | value: propDef |
| 33209 | }; |
| 33210 | // return guessFunctionType(name, propDef); |
| 33211 | |
| 33212 | default: |
| 33213 | return { |
| 33214 | name: name, |
| 33215 | type: 'unknown', |
| 33216 | value: propDef |
| 33217 | }; |
| 33218 | } |
| 33219 | } |
| 33220 | |
| 33221 | function guessArrayType(name, array) { |
| 33222 | if (/color/i.test(name) && (array.length === 3 || array.length === 4)) { |
no test coverage detected