format: prettify entire project

This commit is contained in:
Rim
2025-04-02 06:50:39 -04:00
parent 86f0782a98
commit 7ccc0be712
1711 changed files with 755867 additions and 235931 deletions

View File

@ -67,9 +67,7 @@ var VLQ_CONTINUATION_BIT = VLQ_BASE;
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
*/
function toVLQSigned(aValue) {
return aValue < 0
? ((-aValue) << 1) + 1
: (aValue << 1) + 0;
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
}
/**
@ -81,16 +79,14 @@ function toVLQSigned(aValue) {
function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative
? -shifted
: shifted;
return isNegative ? -shifted : shifted;
}
/**
* Returns the base 64 VLQ encoded value.
*/
exports.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var encoded = '';
var digit;
var vlq = toVLQSigned(aValue);
@ -121,12 +117,12 @@ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
do {
if (aIndex >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
throw new Error('Expected more digits in base 64 VLQ value.');
}
digit = base64.decode(aStr.charCodeAt(aIndex++));
if (digit === -1) {
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
throw new Error('Invalid base64 digit: ' + aStr.charAt(aIndex - 1));
}
continuation = !!(digit & VLQ_CONTINUATION_BIT);