MCPcopy Index your code
hub / github.com/OneNoteDev/WebClipper / alloc

Function alloc

lib/sanitize-html.js:767–781  ·  view source on GitHub ↗
(that, size, fill, encoding)

Source from the content-addressed store, hash-verified

765}
766
767function alloc (that, size, fill, encoding) {
768 assertSize(size)
769 if (size <= 0) {
770 return createBuffer(that, size)
771 }
772 if (fill !== undefined) {
773 // Only pay attention to encoding if it's a string. This
774 // prevents accidentally sending in a number that would
775 // be interpretted as a start offset.
776 return typeof encoding === 'string'
777 ? createBuffer(that, size).fill(fill, encoding)
778 : createBuffer(that, size).fill(fill)
779 }
780 return createBuffer(that, size)
781}
782
783/**
784 * Creates a new filled Buffer instance.

Callers 1

sanitize-html.jsFile · 0.85

Calls 2

assertSizeFunction · 0.85
createBufferFunction · 0.85

Tested by

no test coverage detected