MCPcopy Create free account
hub / github.com/microsoft/SandDance / normalizePropType

Function normalizePropType

docs/tests/v2/es6/js/sanddance.js:33237–33257  ·  view source on GitHub ↗
(name, propDef)

Source from the content-addressed store, hash-verified

33235}
33236
33237function normalizePropType(name, propDef) {
33238 if (!('type' in propDef)) {
33239 if (!('value' in propDef)) {
33240 // If no type and value this object is likely the value
33241 return {
33242 name: name,
33243 type: 'object',
33244 value: propDef
33245 };
33246 }
33247
33248 return Object.assign({
33249 name: name,
33250 type: getTypeOf(propDef.value)
33251 }, propDef);
33252 }
33253
33254 return Object.assign({
33255 name: name
33256 }, propDef);
33257}
33258
33259function parsePropDefinition(propDef) {
33260 var type = propDef.type;

Callers 1

parsePropTypeFunction · 0.85

Calls 1

getTypeOfFunction · 0.70

Tested by

no test coverage detected