mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
JS: Reapply parsing change for json format with optional issuer.
This commit is contained in:
@@ -613,8 +613,7 @@ Amount.prototype.parse_issuer = function (issuer) {
|
|||||||
Amount.prototype.parse_json = function (j) {
|
Amount.prototype.parse_json = function (j) {
|
||||||
if ('string' === typeof j) {
|
if ('string' === typeof j) {
|
||||||
// .../.../... notation is not a wire format. But allowed for easier testing.
|
// .../.../... notation is not a wire format. But allowed for easier testing.
|
||||||
// var m = j.match(/^(.+)\/(...)(?:\/(.+))?$/);
|
var m = j.match(/^([^/]+)\/(...)(?:\/(.+))?$/);
|
||||||
var m = j.match(/^(.+)\/(...)\/(.+)$/);
|
|
||||||
|
|
||||||
if (m) {
|
if (m) {
|
||||||
this._currency = Currency.from_json(m[2]);
|
this._currency = Currency.from_json(m[2]);
|
||||||
|
|||||||
Reference in New Issue
Block a user