@transcend-io/penumbra
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -42,3 +42,3 @@ "use strict"; | ||
var streamsaver_1 = require("streamsaver"); | ||
var typedarray_to_buffer_1 = require("typedarray-to-buffer"); | ||
var toBuffer = require("typedarray-to-buffer"); | ||
/** | ||
@@ -106,8 +106,3 @@ * Fetches an encrypted file from a URL deciphers it, and returns a ReadableStream | ||
return __generator(this, function (_a) { | ||
try { | ||
chunk = typedarray_to_buffer_1.default(chunk); | ||
} | ||
catch (err) { | ||
console.error(err); | ||
} | ||
chunk = toBuffer(chunk); | ||
decryptedChunk = decipher.update(chunk); | ||
@@ -134,3 +129,3 @@ controller.enqueue(decryptedChunk); | ||
} | ||
var chunk = typedarray_to_buffer_1.default(value); | ||
var chunk = toBuffer(value); | ||
// Decrypt chunk | ||
@@ -137,0 +132,0 @@ var decValue = decipher.update(chunk); |
14
index.ts
@@ -5,3 +5,3 @@ // External modules | ||
import { createWriteStream } from 'streamsaver'; | ||
import toBuffer from 'typedarray-to-buffer'; | ||
import * as toBuffer from 'typedarray-to-buffer'; | ||
@@ -29,7 +29,3 @@ // Types | ||
const decipher = createDecipheriv( | ||
'aes-256-gcm', | ||
key, | ||
iv, | ||
); | ||
const decipher = createDecipheriv('aes-256-gcm', key, iv); | ||
@@ -103,7 +99,3 @@ decipher.setAuthTag(authTag); | ||
transform: async (chunk, controller) => { | ||
try { | ||
chunk = toBuffer(chunk); | ||
} catch (err) { | ||
console.error(err); | ||
} | ||
chunk = toBuffer(chunk); | ||
@@ -110,0 +102,0 @@ // Decrypt chunk and send it out |
@@ -22,5 +22,9 @@ declare module 'crypto-browserify' { | ||
type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array; | ||
export default function toBuffer( | ||
function toBuffer( | ||
arr: TypedArray, | ||
): Buffer; | ||
namespace toBuffer {} | ||
export = toBuffer; | ||
} |
{ | ||
"name": "@transcend-io/penumbra", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Crypto streams for the browser.", | ||
@@ -12,3 +12,3 @@ "main": "dist/index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build:clean": "rimraf build && tsc", | ||
"build:clean": "rimraf dist && tsc", | ||
"build:watch": "tsc --watch", | ||
@@ -15,0 +15,0 @@ "build:publish": "npm run build:clean && npm publish" |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1
29772
8
531