Comparing version 4.0.0 to 4.0.1
@@ -25,4 +25,4 @@ var influx = require('../') | ||
for (var i = dbs.length - 1; i >= 0; i--) { | ||
client.deleteDatabase(dbs[i], callbackGenerator(dbs[i])) | ||
client.dropDatabase(dbs[i], callbackGenerator(dbs[i])) | ||
} | ||
}) |
20
index.js
@@ -248,2 +248,12 @@ var InfluxRequest = require('./lib/InfluxRequest.js') | ||
return _.map(object, function (value, key) { | ||
if (typeof value === 'string') { | ||
return key + '="' + value + '"' | ||
} else { | ||
return key + '=' + value | ||
} | ||
}).join(',') | ||
} | ||
InfluxDB.prototype._createKeyTagString = function (object) { | ||
return _.map(object, function (value, key) { | ||
return key + '=' + value | ||
@@ -257,5 +267,5 @@ }).join(',') | ||
_.each(values, function (points) { | ||
var line = seriesName | ||
var line = seriesName.replace(/ /g, '\\ ').replace(/,/g, '\\,') | ||
if (points[1] && _.isObject(points[1]) && _.keys(points[1]).length > 0) { | ||
line += ',' + this._createKeyValueString(points[1]) | ||
line += ',' + this._createKeyTagString(points[1]) | ||
} | ||
@@ -278,3 +288,7 @@ | ||
} else { | ||
line += ' value=' + points[0] | ||
if (typeof points[0] === 'string') { | ||
line += ' value="' + points[0] + '"' | ||
} else { | ||
line += ' value=' + points[0] | ||
} | ||
} | ||
@@ -281,0 +295,0 @@ output.push(line) |
{ | ||
"name": "influx", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "InfluxDB Client", | ||
@@ -23,9 +23,9 @@ "main": "index.js", | ||
"author": "Ben Evans <ben@bensbit.co.uk> (http://bensbit.co.uk)", | ||
"contributors" : [ | ||
"Steffen Konerow <steffen@nrg-media.de> (http://www.nrg-media.de)" | ||
"contributors": [ | ||
"Steffen Konerow <steffen@nrg-media.de> (http://www.nrg-media.de)" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"request": "2.x", | ||
"lodash": "~3.9.3" | ||
"lodash": "^3.10.0", | ||
"request": "2.x" | ||
}, | ||
@@ -35,5 +35,5 @@ "devDependencies": { | ||
"istanbul": "^0.3.2", | ||
"mocha": "^1.21.4", | ||
"standard": "^3.5.0" | ||
"mocha": "2.2.x", | ||
"standard": "4.5.x" | ||
} | ||
} |
@@ -22,5 +22,5 @@ # node-influx | ||
Version 0.3.x is compatible with InfluxDB 0.8.x | ||
Version 3.x.x is compatible with InfluxDB 0.8.x | ||
Version 0.4.x is compatible with InfluxDB 0.9.x | ||
Version 4.x.x is compatible with InfluxDB 0.9.x | ||
@@ -27,0 +27,0 @@ |
13
test.js
@@ -26,3 +26,4 @@ /* eslint-env mocha */ | ||
series: { | ||
name: 'response_time' | ||
name: 'response_time', | ||
strName: 'string_test' | ||
} | ||
@@ -283,2 +284,4 @@ } | ||
describe('#writePoint', function () { | ||
this.timeout(5000) | ||
it('should write a generic point into the database', function (done) { | ||
@@ -300,2 +303,10 @@ dbClient.writePoint(info.series.name, {value: 232, value2: 123}, { foo: 'bar', foobar: 'baz'}, done) | ||
}) | ||
it('should write a point with a string as value into the database', function (done) { | ||
dbClient.writePoint(info.series.strName, {value: 'my test string'}, {}, done) | ||
}) | ||
it('should write a point with a string as value into the database (using different method)', function (done) { | ||
dbClient.writePoint(info.series.strName, 'my second test string', {}, done) | ||
}) | ||
}) | ||
@@ -302,0 +313,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
53771
1104
1
+ Addedlodash@3.10.1(transitive)
- Removedlodash@3.9.3(transitive)
Updatedlodash@^3.10.0