Skip to content

Commit

Permalink
refactor: add the default value of the options parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
bdwenxi committed Nov 9, 2020
1 parent 23007ee commit 11abcc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface IOptions {

type IResolvedResult = [md5: string, abort: () => void];

const file2md5 = function (file: File, options: IOptions): Promise<IResolvedResult> {
const file2md5 = function (file: File, options: IOptions = {}): Promise<IResolvedResult> {
const {chunkSize = 2 * 1024 * 1024, raw = false, onProgress} = options;
const spark = new SparkMD5.ArrayBuffer();
const fileReader = new FileReader();
Expand Down

0 comments on commit 11abcc6

Please sign in to comment.