@@ -268,6 +268,7 @@ function _copyActual(source, target, targetStart, sourceStart, sourceEnd) {
268
268
* runtime deprecation would introduce too much breakage at this time. It's not
269
269
* likely that the Buffer constructors would ever actually be removed.
270
270
* Deprecation Code: DEP0005
271
+ * @returns {Buffer }
271
272
*/
272
273
function Buffer ( arg , encodingOrOffset , length ) {
273
274
showFlaggedDeprecation ( ) ;
@@ -295,6 +296,10 @@ ObjectDefineProperty(Buffer, SymbolSpecies, {
295
296
* Buffer.from(array)
296
297
* Buffer.from(buffer)
297
298
* Buffer.from(arrayBuffer[, byteOffset[, length]])
299
+ * @param {any } value
300
+ * @param {BufferEncoding|number } encodingOrOffset
301
+ * @param {number } [length]
302
+ * @returns {Buffer }
298
303
*/
299
304
Buffer . from = function from ( value , encodingOrOffset , length ) {
300
305
if ( typeof value === 'string' )
@@ -391,6 +396,7 @@ ObjectSetPrototypeOf(Buffer, Uint8Array);
391
396
/**
392
397
* Creates a new filled Buffer instance.
393
398
* alloc(size[, fill[, encoding]])
399
+ * @returns {FastBuffer }
394
400
*/
395
401
Buffer . alloc = function alloc ( size , fill , encoding ) {
396
402
validateNumber ( size , 'size' , 0 , kMaxLength ) ;
@@ -404,6 +410,7 @@ Buffer.alloc = function alloc(size, fill, encoding) {
404
410
/**
405
411
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer
406
412
* instance. If `--zero-fill-buffers` is set, will zero-fill the buffer.
413
+ * @returns {FastBuffer }
407
414
*/
408
415
Buffer . allocUnsafe = function allocUnsafe ( size ) {
409
416
validateNumber ( size , 'size' , 0 , kMaxLength ) ;
@@ -414,6 +421,8 @@ Buffer.allocUnsafe = function allocUnsafe(size) {
414
421
* Equivalent to SlowBuffer(num), by default creates a non-zero-filled
415
422
* Buffer instance that is not allocated off the pre-initialized pool.
416
423
* If `--zero-fill-buffers` is set, will zero-fill the buffer.
424
+ * @param {number } size
425
+ * @returns {FastBuffer|undefined }
417
426
*/
418
427
Buffer . allocUnsafeSlow = function allocUnsafeSlow ( size ) {
419
428
validateNumber ( size , 'size' , 0 , kMaxLength ) ;
0 commit comments