@transcend-io/penumbra
Advanced tools
Comparing version 1.4.0 to 1.4.1
/// <reference types="node" /> | ||
/** | ||
* The type that is emitted as progress continues | ||
*/ | ||
export declare type ProgressEmit = { | ||
/** Detailed emit */ | ||
detail: { | ||
/** Percentage completed */ | ||
percent: number; | ||
/** Total bytes read */ | ||
totalBytesRead: number; | ||
/** Total number of bytes to read */ | ||
contentLength: number; | ||
/** The URL downloading from */ | ||
url: string; | ||
}; | ||
}; | ||
/** | ||
* Download, decrypt, and save a file | ||
@@ -31,1 +47,2 @@ * @param url the URL to fetch the encrypted file from | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -79,3 +79,3 @@ "use strict"; | ||
var percent = Math.round((totalBytesRead / contentLength) * 100); | ||
var event = new CustomEvent(progressEventName, { | ||
var emitContent = { | ||
detail: { | ||
@@ -87,3 +87,4 @@ percent: percent, | ||
}, | ||
}); | ||
}; | ||
var event = new CustomEvent(progressEventName, emitContent); | ||
self.dispatchEvent(event); | ||
@@ -247,1 +248,2 @@ } | ||
exports.getDecryptedContent = getDecryptedContent; | ||
//# sourceMappingURL=index.js.map |
22
index.ts
@@ -52,3 +52,20 @@ // External modules | ||
/** | ||
* The type that is emitted as progress continues | ||
*/ | ||
export type ProgressEmit = { | ||
/** Detailed emit */ | ||
detail: { | ||
/** Percentage completed */ | ||
percent: number, | ||
/** Total bytes read */ | ||
totalBytesRead: number, | ||
/** Total number of bytes to read */ | ||
contentLength: number, | ||
/** The URL downloading from */ | ||
url: string; | ||
} | ||
} | ||
/** | ||
@@ -68,3 +85,3 @@ * An event emitter for the decryption progress | ||
const percent = Math.round((totalBytesRead / contentLength) * 100); | ||
const event = new CustomEvent(progressEventName, { | ||
const emitContent: ProgressEmit = { | ||
detail: { | ||
@@ -76,3 +93,4 @@ percent, | ||
}, | ||
}); | ||
} | ||
const event = new CustomEvent(progressEventName, emitContent); | ||
self.dispatchEvent(event); | ||
@@ -79,0 +97,0 @@ } |
{ | ||
"name": "@transcend-io/penumbra", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Crypto streams for the browser.", | ||
@@ -12,5 +12,5 @@ "main": "dist/index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build:clean": "rimraf dist && tsc", | ||
"build:watch": "tsc --watch", | ||
"build:publish": "npm run build:clean && npm publish" | ||
"prepare": "npm run build", | ||
"build": "rimraf dist && tsc", | ||
"build:watch": "tsc --watch" | ||
}, | ||
@@ -17,0 +17,0 @@ "repository": { |
@@ -6,2 +6,5 @@ { | ||
"declaration": true, | ||
"declarationMap": true, | ||
"sourceMap": true, | ||
"removeComments": false, | ||
"outDir": "./dist", | ||
@@ -8,0 +11,0 @@ "strict": true |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31146
9
584
2