Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@arcana/storage",
"version": "0.1.1",
"version": "0.1.3",
"description": "Upload, Download, Share can be performed using this SDK",
"main": "dist/index.js",
"browser": "dist/index.js",
Expand All @@ -11,9 +11,9 @@
"types"
],
"scripts": {
"build": "npm run build:ts && npm run build:web",
"build:web": "rimraf dist/ && webpack",
"build:ts": "rimraf types/ && tsc --project tsconfig.json",
"build": "rimraf dist types && npm run build:ts && npm run build:web",
"build:web": "webpack",
"build:ts": "tsc --project tsconfig.json",
"prettier": "prettier --write \"src/**/*.ts\" \"test/**/*.js\" ",
"lint": "tslint -p tsconfig.json",
"prepare": "npm run build",
Expand Down Expand Up @@ -60,7 +60,7 @@
"eth-crypto": "^1.9.0",
"eth-sig-util": "^3.0.1",
"ethers": "^5.3.1",
"tus-js-client": "^2.3.0",
"tus-js-client": "^2.3.1",
"tweetnacl": "^1.0.3"
},
"directories": {
Expand Down
7 changes: 1 addition & 6 deletions src/fileReader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import readAsByteArray from 'tus-js-client/lib/browser/readAsByteArray';
import Encryptor from './encrypt';

class FileSource {
Expand All @@ -13,16 +12,12 @@ class FileSource {
}

async slice(start, end) {
if (false) {
return readAsByteArray(this._file.slice(start, end));
}

let value = this._file.slice(start, end);
const en = new Encryptor(this.key, start);
return value.arrayBuffer().then((buffer) => {
return en.encrypt(buffer).then((d) => {
value = new Blob([d]);
return { value };
return { value, done: true };
});
});
}
Expand Down
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
(window as any).global = window;
// @ts-ignore
window.Buffer = window.Buffer || require('buffer').Buffer;

import { Uploader } from './Uploader';
import { Downloader } from './Downloader';
import { Access } from './Access';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"module": "umd",
"module": "commonjs",
"outDir": "dist",
"declaration": true,
"declarationDir": "types",
Expand Down