Skip to content

Commit

Permalink
Merge pull request #198 from Akord-com/blob-polyfill
Browse files Browse the repository at this point in the history
fix: select Blob implementation in runtime
  • Loading branch information
jarrvis authored Nov 6, 2023
2 parents 0006266 + e26232b commit 99ae1f5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/core/file.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import * as mime from "mime-types";
import { v4 as uuid } from "uuid";
import { Readable } from "stream";
import { base64ToArray, digestRaw, signHash } from "@akord/crypto";
import { Service } from "./service";
import { protocolTags, encryptionTags as encTags, fileTags, dataTags, smartweaveTags } from "../constants";
import { base64ToArray, digestRaw, signHash } from "@akord/crypto";
import { Logger } from "../logger";
import { ApiClient } from "../api/api-client";
import { v4 as uuid } from "uuid";
import { FileLike, FileSource } from "../types/file";
import { Blob } from "buffer";
import { Tag, Tags } from "../types/contract";
import { getTxData, getTxMetadata } from "../arweave";
import * as mime from "mime-types";
import { CONTENT_TYPE as MANIFEST_CONTENT_TYPE, FILE_TYPE as MANIFEST_FILE_TYPE } from "./manifest";
import { FileVersion } from "../types/node";
import { Readable } from "stream";
import { BadRequest } from "../errors/bad-request";

const DEFAULT_FILE_TYPE = "text/plain";
Expand Down Expand Up @@ -216,7 +215,7 @@ class FileService extends Service {
let offset = 0;

while (offset < file.size) {
const chunk = file.slice(offset, this.chunkSize + offset);
const chunk = file.slice(offset, this.chunkSize + offset) as Blob;
const { encryptedData, chunkNumber } = await this.encryptChunk(
chunk,
offset,
Expand Down

0 comments on commit 99ae1f5

Please sign in to comment.