Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/wwwroot/mifepriston.org/node_modules/buffer/test/node/ |
Upload File : |
'use strict'; var Buffer = require('../../').Buffer; var assert = require('assert'); var zero = []; var one = [ Buffer.from('asdf') ]; var long = []; for (var i = 0; i < 10; i++) long.push(Buffer.from('asdf')); var flatZero = Buffer.concat(zero); var flatOne = Buffer.concat(one); var flatLong = Buffer.concat(long); var flatLongLen = Buffer.concat(long, 40); assert(flatZero.length === 0); assert(flatOne.toString() === 'asdf'); // A special case where concat used to return the first item, // if the length is one. This check is to make sure that we don't do that. assert(flatOne !== one[0]); assert(flatLong.toString() === (new Array(10 + 1).join('asdf'))); assert(flatLongLen.toString() === (new Array(10 + 1).join('asdf'))); assertWrongList(); assertWrongList(null); assertWrongList(Buffer.from('hello')); assertWrongList([42]); assertWrongList(['hello', 'world']); assertWrongList(['hello', Buffer.from('world')]); function assertWrongList(value) { assert.throws(function() { Buffer.concat(value); }, function(err) { return err instanceof TypeError && err.message === '"list" argument must be an Array of Buffers'; }); }