MCPcopy Index your code
hub / github.com/microsoft/SandDance / parsePropType

Function parsePropType

docs/app/js/sanddance-app.js:68393–68414  ·  view source on GitHub ↗
(propDef)

Source from the content-addressed store, hash-verified

68391 return propTypes;
68392}
68393function parsePropType(propDef) {
68394 var type = getTypeOf(propDef);
68395 if (type === "object") {
68396 if (!propDef) return {
68397 type: "object",
68398 value: null
68399 };
68400 if ("type" in propDef) return Object.assign({}, propDef, TYPE_DEFINITIONS[propDef.type]);
68401 if (!("value" in propDef)) return {
68402 type: "object",
68403 value: propDef
68404 };
68405 type = getTypeOf(propDef.value);
68406 return Object.assign({
68407 type: type
68408 }, propDef, TYPE_DEFINITIONS[type]);
68409 }
68410 return Object.assign({
68411 type: type,
68412 value: propDef
68413 }, TYPE_DEFINITIONS[type]);
68414}
68415function getTypeOf(value) {
68416 if (Array.isArray(value) || ArrayBuffer.isView(value)) return "array";
68417 return (0, _typeofDefault.default)(value);

Callers 1

parsePropTypesFunction · 0.70

Calls 2

getTypeOfFunction · 0.70
normalizePropDefinitionFunction · 0.70

Tested by

no test coverage detected