MCPcopy
hub / github.com/microsoft/SandDance / parsePropTypes

Function parsePropTypes

docs/tests/v2/es6/js/sanddance.js:33160–33180  ·  view source on GitHub ↗
(propDefs)

Source from the content-addressed store, hash-verified

33158};
33159
33160function parsePropTypes(propDefs) {
33161 var propTypes = {};
33162 var defaultProps = {};
33163
33164 var _arr = Object.entries(propDefs);
33165
33166 for (var _i = 0; _i < _arr.length; _i++) {
33167 var _arr$_i = (0, _slicedToArray2.default)(_arr[_i], 2),
33168 propName = _arr$_i[0],
33169 propDef = _arr$_i[1];
33170
33171 var propType = parsePropType(propName, propDef);
33172 propTypes[propName] = propType;
33173 defaultProps[propName] = propType.value;
33174 }
33175
33176 return {
33177 propTypes: propTypes,
33178 defaultProps: defaultProps
33179 };
33180} // Parses one property definition entry. Either contains:
33181// * a valid prop type object ({type, ...})
33182// * or just a default value, in which case type and name inference is used
33183

Callers

nothing calls this directly

Calls 2

parsePropTypeFunction · 0.70
_slicedToArrayFunction · 0.70

Tested by

no test coverage detected