Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const pixelCount = image.size.reduce(reducer, 1)
let componentSize = null
switch (image.imageType.componentType) {
case IntTypes.Int8:
componentSize = 1
break
case IntTypes.UInt8:
componentSize = 1
break
case IntTypes.Int16:
componentSize = 2
break
case IntTypes.UInt16:
componentSize = 2
break
case IntTypes.Int32:
componentSize = 4
break
case IntTypes.UInt32:
componentSize = 4
break
case IntTypes.Int64:
componentSize = 8
break
case IntTypes.UInt64:
componentSize = 8
break
case FloatTypes.Float32:
componentSize = 4
break
case FloatTypes.Float64:
componentSize = 8