MCPcopy Index your code
hub / github.com/plotly/plotly.js / alloc

Function alloc

stackgl_modules/index.js:186–198  ·  view source on GitHub ↗
(size, fill, encoding)

Source from the content-addressed store, hash-verified

184 }
185}
186function alloc(size, fill, encoding) {
187 assertSize(size);
188 if (size <= 0) {
189 return createBuffer(size);
190 }
191 if (fill !== undefined) {
192 // Only pay attention to encoding if it's a string. This
193 // prevents accidentally sending in a number that would
194 // be interpreted as a start offset.
195 return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
196 }
197 return createBuffer(size);
198}
199
200/**
201 * Creates a new filled Buffer instance.

Callers 1

index.jsFile · 0.85

Calls 2

createBufferFunction · 0.85
assertSizeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…