Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function _defaultValue(type: FullSSZType): any {
switch (type.type) {
case Type.bool:
return false;
case Type.uint:
switch (type.use) {
case UintImpl.bn:
return new BN(0);
case UintImpl.bigint:
return BigInt(0);
case UintImpl.number:
return 0;
}
break;
case Type.bitList:
return BitList.fromBitfield(Buffer.alloc(0), 0);
case Type.bitVector:
return BitVector.fromBitfield(
Buffer.alloc(Math.max(1, Math.ceil(type.length / 8))),
type.length);
case Type.byteList:
return Buffer.alloc(0);
case Type.byteVector: