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

Function guessNumberType

docs/tests/v2/es6/js/sanddance.js:33270–33281  ·  view source on GitHub ↗
(name, value)

Source from the content-addressed store, hash-verified

33268}
33269
33270function guessNumberType(name, value) {
33271 var isKnownProp = /radius|scale|width|height|pixel|size|miter/i.test(name) && /^((?!scale).)*$/.test(name);
33272 var max = isKnownProp ? 100 : 1;
33273 var min = 0;
33274 return {
33275 name: name,
33276 type: 'number',
33277 max: Math.max(value, max),
33278 min: Math.min(value, min),
33279 value: value
33280 };
33281} // improved version of javascript typeof that can distinguish arrays and null values
33282
33283
33284function getTypeOf(value) {

Callers 1

parsePropTypeFunction · 0.85

Calls 2

maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected