mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 02:09:22 +02:00
This commit is contained in:
parent
37e90e3dfe
commit
214f5d9fc3
4949 changed files with 1393320 additions and 29 deletions
20
node_modules/mux.js/lib/utils/string.js
generated
vendored
Normal file
20
node_modules/mux.js/lib/utils/string.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
* Returns the first string in the data array ending with a null char '\0'
|
||||
* @param {UInt8} data
|
||||
* @returns the string with the null char
|
||||
*/
|
||||
var uint8ToCString = function(data) {
|
||||
var index = 0;
|
||||
var curChar = String.fromCharCode(data[index]);
|
||||
var retString = '';
|
||||
while (curChar !== '\0') {
|
||||
retString += curChar;
|
||||
index++;
|
||||
curChar = String.fromCharCode(data[index]);
|
||||
}
|
||||
// Add nullChar
|
||||
retString += curChar;
|
||||
return retString;
|
||||
};
|
||||
|
||||
module.exports = { uint8ToCString };
|
19
node_modules/mux.js/lib/utils/typed-array.js
generated
vendored
Normal file
19
node_modules/mux.js/lib/utils/typed-array.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
// IE11 doesn't support indexOf for TypedArrays.
|
||||
// Once IE11 support is dropped, this function should be removed.
|
||||
var typedArrayIndexOf = (typedArray, element, fromIndex) => {
|
||||
if (!typedArray) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
var currentIndex = fromIndex;
|
||||
|
||||
for (; currentIndex < typedArray.length; currentIndex++) {
|
||||
if (typedArray[currentIndex] === element) {
|
||||
return currentIndex;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
||||
|
||||
module.exports = { typedArrayIndexOf };
|
Loading…
Add table
Add a link
Reference in a new issue