@neoskop/ethereal-secrets-client
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -59,3 +59,8 @@ "use strict"; | ||
EtherealSecretsClient.prototype.toBase64 = function (data) { | ||
return window.btoa(String.fromCharCode.apply(null, data)); | ||
var chunkSize = 0x1000; | ||
var chunks = []; | ||
for (var i = 0; i < data.length; i += chunkSize) { | ||
chunks.push(String.fromCharCode.apply(null, data.subarray(i, i + chunkSize))); | ||
} | ||
return window.btoa(chunks.join('')); | ||
}; | ||
@@ -62,0 +67,0 @@ EtherealSecretsClient.prototype.typedArrayToBuffer = function (array) { |
@@ -10,4 +10,8 @@ "use strict"; | ||
chai.use(chaiAsPromised); | ||
global.crypto = new webcrypto_1.Crypto(); | ||
global.window.crypto = global.crypto; | ||
Object.defineProperty(global, 'crypto', { | ||
value: new webcrypto_1.Crypto(), | ||
}); | ||
Object.defineProperty(window, 'crypto', { | ||
value: new webcrypto_1.Crypto(), | ||
}); | ||
done(); | ||
@@ -137,3 +141,12 @@ }); | ||
}); | ||
it('should allow storage of large inputs', function () { | ||
var sut = createClient(); | ||
var randomValues = new Uint8Array(200000); | ||
window.crypto.getRandomValues(randomValues); | ||
var bigInput = Array.from(randomValues, function (dec) { | ||
return dec.toString(16).padStart(2, '0'); | ||
}).join(''); | ||
return sut.saveLocal('foo', bigInput).should.eventually.be.fulfilled; | ||
}); | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@neoskop/ethereal-secrets-client", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"main": "dist/index.js", | ||
@@ -26,4 +26,4 @@ "typings": "dist/index.d.ts", | ||
"chai-as-promised": "7.1.1", | ||
"concurrently": "7.2.1", | ||
"jsdom": "19.0.0", | ||
"concurrently": "7.2.2", | ||
"jsdom": "20.0.0", | ||
"jsdom-global": "3.0.2", | ||
@@ -34,9 +34,9 @@ "mocha": "10.0.0", | ||
"nyc": "15.1.0", | ||
"prettier": "2.6.2", | ||
"prettier": "2.7.1", | ||
"rimraf": "3.0.2", | ||
"ts-node": "10.8.1", | ||
"typescript": "4.7.3" | ||
"typescript": "4.7.4" | ||
}, | ||
"dependencies": { | ||
"superagent": "7.1.6" | ||
"superagent": "8.0.0" | ||
}, | ||
@@ -43,0 +43,0 @@ "nyc": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
39337
534
+ Addedsuperagent@8.0.0(transitive)
- Removedsuperagent@7.1.6(transitive)
Updatedsuperagent@8.0.0