@canboat/canboatjs 2.5.3 → 2.5.4

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.
@@ -0,0 +1,28 @@
1
+ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3
+
4
+ name: Node.js CI & Test
5
+
6
+ on:
7
+ push:
8
+ branches: [ "master" ]
9
+ pull_request:
10
+ branches: [ "master" ]
11
+
12
+ jobs:
13
+ build:
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ strategy:
18
+ matrix:
19
+ node-version: [16.x, 18.x, 20.x]
20
+
21
+ steps:
22
+ - uses: actions/checkout@v3
23
+ - name: Use Node.js ${{ matrix.node-version }}
24
+ uses: actions/setup-node@v3
25
+ with:
26
+ node-version: ${{ matrix.node-version }}
27
+ - run: npm install
28
+ - run: npm test
package/lib/fromPgn.js CHANGED
@@ -24,7 +24,6 @@ const BitStream = require('bit-buffer').BitStream
24
24
  const BitView = require('bit-buffer').BitView
25
25
  const Int64LE = require('int64-buffer').Int64LE
26
26
  const Uint64LE = require('int64-buffer').Uint64LE
27
- const { parse: parseDate } = require('date-fns')
28
27
 
29
28
  const { getPGNFromCanId } = require('./utilities')
30
29
  const { getIndustryName, getManufacturerName } = require('./codes')
@@ -120,9 +119,7 @@ class Parser extends EventEmitter {
120
119
  })
121
120
  }
122
121
 
123
- const RepeatingFields = pgnData.RepeatingFieldSet1Size ? pgnData.RepeatingFieldSet1Size : 0
124
-
125
- trace(`${pgn.pgn} ${len} ${pgnData.Length} ${RepeatingFields} ${couldBeMulti}`)
122
+ trace(`${pgn.pgn} ${len} ${pgnData.Length} ${couldBeMulti}`)
126
123
  if ( coalesced || len > 0x8 || (this.format == FORMAT_COALESCED && !this.mixedFormat) ) {
127
124
  this.format = FORMAT_COALESCED
128
125
  if ( sourceString ) {
@@ -204,6 +201,8 @@ class Parser extends EventEmitter {
204
201
  pgn.input = [ sourceString ]
205
202
  }
206
203
 
204
+ let RepeatingFields = pgnData.RepeatingFieldSet1Size ? pgnData.RepeatingFieldSet1Size : 0
205
+
207
206
  pgn.fields = {}
208
207
  try {
209
208
  var fields = pgnData.Fields
@@ -246,6 +245,7 @@ class Parser extends EventEmitter {
246
245
  if ( value == null ) {
247
246
  value = pgnData.Fields[i].Match
248
247
  }
248
+ RepeatingFields = pgnData.RepeatingFieldSet1Size ? pgnData.RepeatingFieldSet1Size : 0
249
249
  }
250
250
  }
251
251
 
package/lib/stringMsg.js CHANGED
@@ -8,7 +8,6 @@ const {
8
8
  const {
9
9
  buildCanId, encodeCanIdString, parseCanId, parseCanIdStr,
10
10
  } = require('./canId')
11
- const { parse: parseDate } = require('date-fns')
12
11
 
13
12
  /**
14
13
  * Helper function that helps merge canId fields with format, data, and others.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canboat/canboatjs",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "Native javascript version of canboat",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -57,7 +57,6 @@
57
57
  "dependencies": {
58
58
  "@canboat/pgns": "3.x.x",
59
59
  "bit-buffer": "0.2.3",
60
- "date-fns": "2.0.0-alpha.27",
61
60
  "debug": "^4.3.4",
62
61
  "dnssd": "^0.4.1",
63
62
  "int64-buffer": "^0.1.10",