Skip to content

Commit

Permalink
Resolve #7
Browse files Browse the repository at this point in the history
  • Loading branch information
adefirmanf committed Jun 13, 2019
1 parent fd403ff commit d8266ee
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions iso8583.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,32 @@ class ISO8583 {
}
static value(data) {}
set(name, value) {
if (this._temp.get(name)) {
const { length, bitmap } = this._temp.get(name);
let f
if (!this._temp.get(name)){
f = new ReferenceError(`'${name}' is not defined in initialization.`)
throw f
}
const { length, bitmap } = this._temp.get(name);
/**
* Create 0..n value until meet condition length MAX
*/
value = new Array(length)
.fill(0, 0, length)
/**
* When value is exist, slice an array with `value.length`
*/
.slice(value.length)
/**
* Create 0..n value until meet condition length MAX
* Split a string and then concat into previous array
*/
value = new Array(length)
.fill(0, 0, length)
/**
* When value is exist, slice an array with `value.length`
*/
.slice(value.length)
/**
* Split a string and then concat into previous array
*/
.concat(value.split(''))
/**
* Convert into string
*/
.join('');
.concat(value.split(''))
/**
* Convert into string
*/
.join('');

return this._value.set(name, { ...this._temp.get(name), value });
}
f = this._value.set(name, { ...this._temp.get(name), value });
return f
}
get(name, value) {}
wrapMsg(mti = '', opts) {
Expand Down

0 comments on commit d8266ee

Please sign in to comment.