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

Function guessArrayType

docs/tests/v2/es6/js/sanddance.js:33221–33235  ·  view source on GitHub ↗
(name, array)

Source from the content-addressed store, hash-verified

33219}
33220
33221function guessArrayType(name, array) {
33222 if (/color/i.test(name) && (array.length === 3 || array.length === 4)) {
33223 return {
33224 name: name,
33225 type: 'color',
33226 value: array
33227 };
33228 }
33229
33230 return {
33231 name: name,
33232 type: 'array',
33233 value: array
33234 };
33235}
33236
33237function normalizePropType(name, propDef) {
33238 if (!('type' in propDef)) {

Callers 1

parsePropTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected