trezor-link
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -6,2 +6,5 @@ 'use strict'; | ||
}); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
exports.setFetch = setFetch; | ||
@@ -54,8 +57,7 @@ exports.request = request; | ||
if (options.skipContentTypeHeader == null || options.skipContentTypeHeader === false) { | ||
fetchOptions = { | ||
...fetchOptions, | ||
fetchOptions = _extends({}, fetchOptions, { | ||
headers: { | ||
'Content-Type': contentType(options.body == null ? `` : options.body) | ||
} | ||
}; | ||
}); | ||
} | ||
@@ -62,0 +64,0 @@ const res = await _fetch(options.url, fetchOptions); |
@@ -8,2 +8,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _desc, _value, _class; | ||
@@ -73,7 +75,7 @@ | ||
async _post(options) { | ||
return await (0, _http.request)({ ...options, method: `POST`, url: this.url + options.url }); | ||
return await (0, _http.request)(_extends({}, options, { method: `POST`, url: this.url + options.url })); | ||
} | ||
async _get(options) { | ||
return await (0, _http.request)({ ...options, method: `GET`, url: this.url + options.url }); | ||
return await (0, _http.request)(_extends({}, options, { method: `GET`, url: this.url + options.url })); | ||
} | ||
@@ -114,8 +116,7 @@ | ||
body: old.map(device => { | ||
return { | ||
...device, | ||
return _extends({}, device, { | ||
// hack for old trezord | ||
product: 1, | ||
vendor: 21324 | ||
}; | ||
}); | ||
}) | ||
@@ -122,0 +123,0 @@ })); |
@@ -14,2 +14,4 @@ | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _desc, _value, _class; | ||
@@ -87,3 +89,3 @@ | ||
async _post(options) { | ||
return await (0, _http.request)({ ...options, method: `POST`, url: this.url + options.url, skipContentTypeHeader: true }); | ||
return await (0, _http.request)(_extends({}, options, { method: `POST`, url: this.url + options.url, skipContentTypeHeader: true })); | ||
} | ||
@@ -90,0 +92,0 @@ |
@@ -8,2 +8,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _desc, _value, _class; | ||
@@ -139,3 +141,3 @@ | ||
if (session != null) { | ||
res = { session, ...res }; | ||
res = _extends({ session }, res); | ||
} | ||
@@ -142,0 +144,0 @@ return res; |
@@ -56,3 +56,3 @@ 'use strict'; | ||
this.name = `WebUsbPlugin`; | ||
this.version = "1.0.2"; | ||
this.version = "1.0.3"; | ||
this.debug = false; | ||
@@ -59,0 +59,0 @@ this.allowsWriteAndEnumerate = true; |
@@ -8,2 +8,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _desc, _value, _class; | ||
@@ -164,3 +166,3 @@ | ||
async acquire(input) { | ||
const messBack = await this.sendToWorker({ type: `acquire-intent`, ...input }); | ||
const messBack = await this.sendToWorker(_extends({ type: `acquire-intent` }, input)); | ||
if (messBack.type === `wrong-previous-session`) { | ||
@@ -167,0 +169,0 @@ throw new Error(`wrong previous session`); |
@@ -8,2 +8,4 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _desc, _value, _class; | ||
@@ -71,7 +73,6 @@ | ||
return devices.filter(device => this._parseName(device.path).name === name).map(device => { | ||
return { | ||
...device, | ||
return _extends({}, device, { | ||
path: this._parseName(device.path).rest, | ||
session: device.session == null ? device.session : this._parseName(device.session).rest | ||
}; | ||
}); | ||
}); | ||
@@ -78,0 +79,0 @@ } |
{ | ||
"name": "trezor-link", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Trezor Link for browser", | ||
@@ -36,3 +36,3 @@ "main": "lib/index.js", | ||
"syntax-class-properties", | ||
"syntax-object-rest-spread", | ||
"transform-object-rest-spread", | ||
"transform-class-properties", | ||
@@ -53,3 +53,3 @@ "add-module-exports", | ||
"babel-plugin-syntax-class-properties": "^6.13.0", | ||
"babel-plugin-syntax-object-rest-spread": "^6.13.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
@@ -56,0 +56,0 @@ "babel-plugin-transform-decorators-legacy": "^1.3.4", |
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
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
275347
3842