Minor renaming of variables

This commit is contained in:
Raymond Hill 2024-02-29 09:18:07 -05:00
parent ba95d2bc49
commit d7154de9e9
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 8 additions and 8 deletions

View File

@ -135,17 +135,17 @@ const cacheStorage = (( ) => {
return keys;
},
async set(inbin) {
const keys = Object.keys(inbin);
async set(rawbin) {
const keys = Object.keys(rawbin);
if ( keys.length === 0 ) { return; }
const bin = {};
const serializedbin = {};
const promises = [];
for ( const key of keys ) {
promises.push(compress(bin, key, inbin[key]));
promises.push(compress(serializedbin, key, rawbin[key]));
}
await Promise.all(promises);
cacheAPIs[fastCache].set(inbin, bin);
return extensionStorage.set(bin).catch(reason => {
cacheAPIs[fastCache].set(rawbin, serializedbin);
return extensionStorage.set(serializedbin).catch(reason => {
ubolog(reason);
});
},

View File

@ -224,7 +224,7 @@ const xtypeToSerializedInt = {
'[object DataView]': I_DATAVIEW,
};
const typeToSerializedChar = {
const xtypeToSerializedChar = {
'[object Int8Array]': C_INT8ARRAY,
'[object Uint8Array]': C_UINT8ARRAY,
'[object Uint8ClampedArray]': C_UINT8CLAMPEDARRAY,
@ -664,7 +664,7 @@ const _serialize = data => {
case I_FLOAT32ARRAY:
case I_FLOAT64ARRAY:
writeBuffer.push(
typeToSerializedChar[xtypeName],
xtypeToSerializedChar[xtypeName],
strFromLargeUint(data.byteOffset),
strFromLargeUint(data.length)
);