Skip to content

Commit 01275c8

Browse files
committed
Updated dependencies. Removed testling.
1 parent 844a047 commit 01275c8

File tree

6 files changed

+31
-39
lines changed

6 files changed

+31
-39
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ build/Release
2525
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
2626
node_modules
2727
spec.html spec.md
28+
29+
package-lock.json

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ node_js:
55
- "7"
66
- "8"
77
- "9"
8+
- "10"

lib/decoder.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict'
2+
13
var bl = require('bl')
24
var util = require('util')
35

@@ -376,18 +378,20 @@ module.exports = function buildDecode (decodingTypes) {
376378
var type = buf.readInt8(offset + 1) // Signed
377379
return decodeExt(buf, offset, type, size, 2)
378380
}
381+
379382
function decodeTimestamp (buf, size, headerSize) {
380-
var seconds, nanoseconds
381-
nanoseconds = 0
383+
var seconds
384+
var nanoseconds = 0
382385

383386
switch (size) {
384387
case 4:
385-
// timestamp 32 stores the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC in an 32-bit unsigned integer
388+
// timestamp 32 stores the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC in an 32-bit unsigned integer
386389
seconds = buf.readUInt32BE(0)
387390
break
388391

389-
case 8: // Timestamp 64 stores the number of seconds and nanoseconds that have elapsed
390-
// since 1970-01-01 00:00:00 UTC in 32-bit unsigned integers, split 30/34 bits
392+
case 8:
393+
// Timestamp 64 stores the number of seconds and nanoseconds that have elapsed
394+
// since 1970-01-01 00:00:00 UTC in 32-bit unsigned integers, split 30/34 bits
391395
var upper = buf.readUInt32BE(0)
392396
var lower = buf.readUInt32BE(4)
393397
nanoseconds = upper / 4

lib/encoder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ var TOLERANCE = 0.1
66

77
module.exports = function buildEncode (encodingTypes, forceFloat64, compatibilityMode, disableTimestampEncoding) {
88
function encode (obj, avoidSlice) {
9-
var buf,
10-
len
9+
var buf
10+
var len
1111

1212
if (obj === undefined) {
1313
throw new Error('undefined is not encodable in msgpack!')
@@ -158,7 +158,7 @@ module.exports = function buildEncode (encodingTypes, forceFloat64, compatibilit
158158
var nanos = (millis - (seconds * 1000)) * 1E6
159159

160160
if (nanos || seconds > 0xFFFFFFFF) {
161-
// Timestamp64
161+
// Timestamp64
162162
encoded = Buffer.allocUnsafe(10)
163163
encoded[0] = 0xd7
164164
encoded[1] = -1
@@ -171,7 +171,7 @@ module.exports = function buildEncode (encodingTypes, forceFloat64, compatibilit
171171
encoded.writeInt32BE(upper, 2)
172172
encoded.writeInt32BE(lower, 6)
173173
} else {
174-
// Timestamp32
174+
// Timestamp32
175175
encoded = Buffer.allocUnsafe(6)
176176
encoded[0] = 0xd6
177177
encoded[1] = -1

package.json

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"test": "standard && tape test/* | tap-mocha-reporter dot",
88
"build": "npm run browserify && npm run dist",
99
"browserify": "browserify index.js -o dist/msgpack5.js -s msgpack5",
10-
"dist": "uglifyjs dist/msgpack5.js -o dist/msgpack5.min.js",
11-
"test-browser": "browserify test/* | testling -u"
10+
"dist": "uglifyjs dist/msgpack5.js -o dist/msgpack5.min.js"
1211
},
1312
"pre-commit": [
1413
"test"
@@ -31,37 +30,23 @@
3130
},
3231
"homepage": "https://github.com/mcollina/msgpack5",
3332
"devDependencies": {
34-
"browserify": "^15.0.0",
33+
"browserify": "^16.2.0",
3534
"memdb": "^1.3.1",
3635
"pre-commit": "^1.2.2",
37-
"standard": "^10.0.3",
38-
"tap-mocha-reporter": "^3.0.6",
39-
"tape": "^4.8.0",
40-
"testling": "^1.7.1",
41-
"uglify-js": "^3.3.5"
36+
"standard": "^11.0.1",
37+
"tap-mocha-reporter": "^3.0.7",
38+
"tape": "^4.9.0",
39+
"uglify-js": "^3.3.25"
4240
},
4341
"standard": {
4442
"ignore": [
4543
"dist/"
4644
]
4745
},
48-
"testling": {
49-
"files": "test/*.js",
50-
"browsers": [
51-
"ie/6..latest",
52-
"chrome/22..latest",
53-
"firefox/16..latest",
54-
"safari/latest",
55-
"opera/11.0..latest",
56-
"iphone/6",
57-
"ipad/6",
58-
"android-browser/latest"
59-
]
60-
},
6146
"dependencies": {
62-
"bl": "^1.2.1",
47+
"bl": "^2.0.0",
6348
"inherits": "^2.0.3",
64-
"readable-stream": "^2.3.3",
65-
"safe-buffer": "^5.1.1"
49+
"readable-stream": "^2.3.6",
50+
"safe-buffer": "^5.1.2"
6651
}
6752
}

test/timestamps.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var msgpack = require('../')
77
test('timestamp disabling', function (t) {
88
var encoder = msgpack({disableTimestampEncoding: true})
99
var timestamps = [
10-
[new Date('2018-01-02T03:04:05.000000000Z'), [0x80]]
10+
[new Date('2018-01-02T03:04:05.000000000Z'), [0x80]]
1111
]
1212

1313
timestamps.forEach(function (testcase) {
@@ -27,11 +27,11 @@ test('timestamp disabling', function (t) {
2727
test('encoding/decoding timestamp 64', function (t) {
2828
var encoder = msgpack()
2929
var timestamps = [
30-
[new Date('2018-01-02T03:04:05.000000000Z'), [0xd6, 0xff, 0x5a, 0x4a, 0xf6, 0xa5]],
31-
[new Date('2038-01-19T03:14:08.000000000Z'), [0xd6, 0xff, 0x80, 0x00, 0x00, 0x00]],
32-
[new Date('2038-01-19T03:14:07.999000000Z'), [0xd7, 0xff, 0xee, 0x2E, 0x1F, 0x00, 0x7f, 0xff, 0xff, 0xff]],
33-
[new Date('2106-02-07T06:28:16.000000000Z'), [0xd7, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00]],
34-
[new Date('2018-01-02T03:04:05.678000000Z'), [0xd7, 0xff, 0xa1, 0xa5, 0xd6, 0x00, 0x5a, 0x4a, 0xf6, 0xa5]]
30+
[new Date('2018-01-02T03:04:05.000000000Z'), [0xd6, 0xff, 0x5a, 0x4a, 0xf6, 0xa5]],
31+
[new Date('2038-01-19T03:14:08.000000000Z'), [0xd6, 0xff, 0x80, 0x00, 0x00, 0x00]],
32+
[new Date('2038-01-19T03:14:07.999000000Z'), [0xd7, 0xff, 0xee, 0x2E, 0x1F, 0x00, 0x7f, 0xff, 0xff, 0xff]],
33+
[new Date('2106-02-07T06:28:16.000000000Z'), [0xd7, 0xff, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00]],
34+
[new Date('2018-01-02T03:04:05.678000000Z'), [0xd7, 0xff, 0xa1, 0xa5, 0xd6, 0x00, 0x5a, 0x4a, 0xf6, 0xa5]]
3535
]
3636

3737
timestamps.forEach(function (testcase) {

0 commit comments

Comments
 (0)