MCPcopy
hub / github.com/feross/buffer / assertSize

Function assertSize

index.js:182–188  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

180Object.setPrototypeOf(Buffer, Uint8Array)
181
182function assertSize (size) {
183 if (typeof size !== 'number') {
184 throw new TypeError('"size" argument must be of type number')
185 } else if (size < 0) {
186 throw new RangeError('The value "' + size + '" is invalid for option "size"')
187 }
188}
189
190function alloc (size, fill, encoding) {
191 assertSize(size)

Callers 2

allocFunction · 0.85
allocUnsafeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…