MCPcopy Create free account
hub / github.com/bitpay/bitcore-message / assertSize

Function assertSize

bitcore-message.js:455–461  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

453}
454
455function assertSize (size) {
456 if (typeof size !== 'number') {
457 throw new TypeError('"size" argument must be a number')
458 } else if (size < 0) {
459 throw new RangeError('"size" argument must not be negative')
460 }
461}
462
463function alloc (that, size, fill, encoding) {
464 assertSize(size)

Callers 2

allocFunction · 0.85
allocUnsafeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected