@canboat/canboatjs 2.5.1 → 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/fromPgn.js CHANGED
@@ -517,7 +517,7 @@ function getField(pgn, index, data) {
517
517
 
518
518
  if ( pgnList.length > 1 ) {
519
519
  let idx = 0
520
- while ( idx < pgn.Fields.count )
520
+ while ( idx < pgn.Fields.length )
521
521
  {
522
522
  field = pgn.Fields[idx]
523
523
  var hasMatch = !_.isUndefined(field.Match)
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 ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canboat/canboatjs",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "Native javascript version of canboat",
5
5
  "main": "index.js",
6
6
  "scripts": {