@canboat/canboatjs 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/toPgn.js +10 -1
- package/package.json +1 -1
package/lib/toPgn.js
CHANGED
|
@@ -34,9 +34,11 @@ const RES_STRINGLZ = 'STRING_LZ' //'ASCII string starting with length byte'
|
|
|
34
34
|
var fieldTypeWriters = {}
|
|
35
35
|
var fieldTypeMappers = {}
|
|
36
36
|
|
|
37
|
-
|
|
38
37
|
var lengthsOff = { 129029: 45, 127257:8, 127258:8, 127251:8 }
|
|
39
38
|
|
|
39
|
+
const a126208_oldKey = '# of Parameters'
|
|
40
|
+
const a126208_newKey = 'Number of Parameters'
|
|
41
|
+
|
|
40
42
|
function toPgn(data) {
|
|
41
43
|
const customPgns = getCustomPgn(data.pgn)
|
|
42
44
|
let pgnList = pgns[data.pgn]
|
|
@@ -71,6 +73,13 @@ function toPgn(data) {
|
|
|
71
73
|
data = data.fields
|
|
72
74
|
}
|
|
73
75
|
|
|
76
|
+
if ( pgn_number === 126208 && !data[a126208_newKey] && data[a126208_oldKey] ) {
|
|
77
|
+
//a bit of a hack because this field name changed and I'm sure there is code out
|
|
78
|
+
//there that still uses the old field name
|
|
79
|
+
|
|
80
|
+
data[a126208_newKey] = data[a126208_oldKey]
|
|
81
|
+
}
|
|
82
|
+
|
|
74
83
|
var fields = pgnData.Fields
|
|
75
84
|
if ( !_.isArray(fields) ) {
|
|
76
85
|
fields = [ fields.Field ]
|