@alertlogic/al-collector-js 3.0.11 → 3.0.13
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/package.json +7 -7
- package/parse.js +2 -2
- package/test/parse_test.js +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alertlogic/al-collector-js",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Alert Logic Collector Common Library",
|
|
6
6
|
"repository": {
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
],
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"jshint": "^2.13.6",
|
|
24
|
-
"mocha": "^10.
|
|
24
|
+
"mocha": "^10.7.0",
|
|
25
25
|
"mocha-jenkins-reporter": "^0.4.8",
|
|
26
26
|
"nock": "^13.5.4",
|
|
27
|
-
"nyc": "^
|
|
27
|
+
"nyc": "^17.0.0",
|
|
28
28
|
"rewire": "^7.0.0",
|
|
29
|
-
"sinon": "^18.0.
|
|
29
|
+
"sinon": "^18.0.1",
|
|
30
30
|
"timekeeper": "^2.3.1"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"async": "3.2.
|
|
34
|
-
"axios": "^1.7.
|
|
35
|
-
"debug": "4.3.
|
|
33
|
+
"async": "3.2.6",
|
|
34
|
+
"axios": "^1.7.7",
|
|
35
|
+
"debug": "4.3.7",
|
|
36
36
|
"lodash.clonedeep": "^4.5.0",
|
|
37
37
|
"lodash.filter": "^4.6.0",
|
|
38
38
|
"lodash.remove": "^4.7.0",
|
package/parse.js
CHANGED
|
@@ -30,8 +30,8 @@ var defaultTs = function() {
|
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
var parseTs = function(ts) {
|
|
34
|
-
var milli = Date.parse(ts);
|
|
33
|
+
var parseTs = function (ts) {
|
|
34
|
+
var milli = typeof ts === 'number' ? ts : Date.parse(ts);
|
|
35
35
|
if (isNaN(milli)) {
|
|
36
36
|
return defaultTs();
|
|
37
37
|
} else {
|
package/test/parse_test.js
CHANGED
|
@@ -135,6 +135,13 @@ describe('Common parse functions unit tests.', function() {
|
|
|
135
135
|
assert.deepEqual(privParseTs('foo'), { sec: 1234567, usec: null });
|
|
136
136
|
done();
|
|
137
137
|
});
|
|
138
|
+
|
|
139
|
+
it('timestamp input in milliseconds', function (done) {
|
|
140
|
+
let parseWire1 = rewire('../parse');
|
|
141
|
+
var privParseTs = parseWire1.__get__('parseTs');
|
|
142
|
+
assert.deepEqual(privParseTs(1721143248000), { sec: 1721143248, usec: null });
|
|
143
|
+
done();
|
|
144
|
+
});
|
|
138
145
|
|
|
139
146
|
it('iteratePropPaths zero key', function(done) {
|
|
140
147
|
const testPaths = [
|