Refactor src/worker/*.js to use import and export
This commit is contained in:
parent
444128829a
commit
9ebe31a4ec
|
@ -26,10 +26,10 @@
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var crypto = require('../crypto'),
|
import crypto from '../crypto';
|
||||||
packet = require('../packet'),
|
import packet from '../packet';
|
||||||
key = require('../key.js'),
|
import key from '../key.js';
|
||||||
type_keyid = require('../type/keyid.js');
|
import type_keyid from '../type/keyid.js';
|
||||||
|
|
||||||
var INITIAL_RANDOM_SEED = 50000, // random bytes seeded to worker
|
var INITIAL_RANDOM_SEED = 50000, // random bytes seeded to worker
|
||||||
RANDOM_SEED_REQUEST = 20000; // random bytes seeded after worker request
|
RANDOM_SEED_REQUEST = 20000; // random bytes seeded after worker request
|
||||||
|
@ -42,7 +42,7 @@ var INITIAL_RANDOM_SEED = 50000, // random bytes seeded to worker
|
||||||
* @param {Object} [options.worker=Object] alternative to path parameter:
|
* @param {Object} [options.worker=Object] alternative to path parameter:
|
||||||
* web worker initialized with 'openpgp.worker.js'
|
* web worker initialized with 'openpgp.worker.js'
|
||||||
*/
|
*/
|
||||||
function AsyncProxy(path, options) {
|
export default function AsyncProxy(path, options) {
|
||||||
if (options && options.worker) {
|
if (options && options.worker) {
|
||||||
this.worker = options.worker;
|
this.worker = options.worker;
|
||||||
} else {
|
} else {
|
||||||
|
@ -435,5 +435,3 @@ AsyncProxy.prototype.decryptKeyPacket = function(privateKey, keyIds, password) {
|
||||||
|
|
||||||
return promise;
|
return promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = AsyncProxy;
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user