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

Function checked

docs/app/js/sanddance-app.js:113050–113055  ·  view source on GitHub ↗
(length)

Source from the content-addressed store, hash-verified

113048 if (obj.type === "Buffer" && Array.isArray(obj.data)) return fromArrayLike(obj.data);
113049}
113050function checked(length) {
113051 // Note: cannot use `length < K_MAX_LENGTH` here because that fails when
113052 // length is NaN (which is otherwise coerced to zero.)
113053 if (length >= K_MAX_LENGTH) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
113054 return length | 0;
113055}
113056function SlowBuffer(length) {
113057 if (+length != length) length = 0;
113058 return Buffer.alloc(+length);

Callers 3

allocUnsafeFunction · 0.70
fromArrayLikeFunction · 0.70
fromObjectFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected