Skip to content

Commit

Permalink
feat: Assert params
Browse files Browse the repository at this point in the history
  • Loading branch information
rrr523 committed Dec 24, 2023
1 parent f5f65ce commit ba3ca65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions packages/reed-solomon/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ export class ReedSolomon {
};
}

/**
* @param {Array[{index, segChecksum, encodeDataHash}]} encodeShards
*/
getChecksumsByEncodeShards(encodeShards) {
let hashList = [];
let segChecksumList = [];
Expand Down
3 changes: 3 additions & 0 deletions packages/reed-solomon/src/web.adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export class WebAdapterReedSolomon extends ReedSolomon {
}

async encodeInWorker(sourceData) {
if (!this.workerNum || !this.workers)
throw new Error('`initWorkers` must be executed first to ensure the number of workers');

// RES is `encodeShards` Array
let RES = [];
const chunkList = splitPrice(sourceData, this.segmentSize);
Expand Down

0 comments on commit ba3ca65

Please sign in to comment.