MCPcopy Create free account
hub / github.com/microsoft/SandDance / assertSize

Function assertSize

docs/app/js/sanddance-app.js:112967–112970  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

112965Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype);
112966Object.setPrototypeOf(Buffer, Uint8Array);
112967function assertSize(size) {
112968 if (typeof size !== "number") throw new TypeError('"size" argument must be of type number');
112969 else if (size < 0) throw new RangeError('The value "' + size + '" is invalid for option "size"');
112970}
112971function alloc(size, fill, encoding) {
112972 assertSize(size);
112973 if (size <= 0) return createBuffer(size);

Callers 2

allocFunction · 0.70
allocUnsafeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected