MCPcopy Create free account
hub / github.com/UI5/webcomponents / from

Function from

packages/main/test/pages/diffable-html.js:243–257  ·  view source on GitHub ↗
(value, encodingOrOffset, length)

Source from the content-addressed store, hash-verified

241 Buffer.poolSize = 8192 // not used by this implementation
242
243 function from (value, encodingOrOffset, length) {
244 if (typeof value === 'number') {
245 throw new TypeError('"value" argument must not be a number')
246 }
247
248 if (isArrayBuffer(value) || (value && isArrayBuffer(value.buffer))) {
249 return fromArrayBuffer(value, encodingOrOffset, length)
250 }
251
252 if (typeof value === 'string') {
253 return fromString(value, encodingOrOffset)
254 }
255
256 return fromObject(value)
257 }
258
259 /**
260 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError

Callers 2

BufferFunction · 0.85
diffable-html.jsFile · 0.85

Calls 4

isArrayBufferFunction · 0.85
fromArrayBufferFunction · 0.85
fromStringFunction · 0.85
fromObjectFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…