1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

New updates and modules

This commit is contained in:
DanieL 2022-07-15 11:08:01 -03:00
parent 4d5d408898
commit 0abf0f90f6
959 changed files with 364301 additions and 17493 deletions

28
node_modules/clone-buffer/index.js generated vendored Normal file
View file

@ -0,0 +1,28 @@
'use strict';
var Buffer = require('buffer').Buffer;
function hasFrom() {
// Node versions 5.x below 5.10 seem to have a `from` method
// However, it doesn't clone Buffers
// Luckily, it reports as `false` to hasOwnProperty
return (Buffer.hasOwnProperty('from') && typeof Buffer.from === 'function');
}
function cloneBuffer(buf) {
if (!Buffer.isBuffer(buf)) {
throw new Error('Can only clone Buffer.');
}
if (hasFrom()) {
return Buffer.from(buf);
}
var copy = new Buffer(buf.length);
buf.copy(copy);
return copy;
}
cloneBuffer.hasFrom = hasFrom;
module.exports = cloneBuffer;