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