elasticsearch
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -23,3 +23,3 @@ var | ||
Object.keys(defaults).forEach(function (key) { | ||
if (!options.hasOwnProperty(key)) { | ||
if (!options[key]) { | ||
options[key] = defaults[key]; | ||
@@ -26,0 +26,0 @@ } |
@@ -51,2 +51,11 @@ var | ||
function exec (options, data, callback) { | ||
data = data || ''; | ||
if (typeof data !== 'string') { | ||
data = JSON.stringify(data); | ||
} | ||
if (!options.headers) { | ||
options.headers = {}; | ||
} | ||
options.headers['Content-Length'] = Buffer.byteLength(data); | ||
var req = | ||
@@ -137,6 +146,2 @@ (options.secure ? https : http).request(options, function (res) { | ||
if (data) { | ||
if (typeof data !== 'string') { | ||
data = JSON.stringify(data); | ||
} | ||
req.write(data); | ||
@@ -311,2 +316,2 @@ } | ||
return self; | ||
}; | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"main" : "index.js", | ||
"version" : "0.3.5", | ||
"version" : "0.3.6", | ||
"author" : "Nick Campbell (http://github.com/ncb000gt)", | ||
@@ -12,7 +12,8 @@ "contributors" : [ | ||
"Richard Marr (http://github.com/richmarr)", | ||
"Joshua Thomas (http://github.com/brozeph)"], | ||
"engines" : { | ||
"node" : ">= 0.8.0" | ||
"Joshua Thomas (http://github.com/brozeph)" | ||
], | ||
"engines": { | ||
"node": ">= 0.8.0" | ||
}, | ||
"keywords" : [ | ||
"keywords": [ | ||
"elastic", | ||
@@ -24,20 +25,20 @@ "search", | ||
], | ||
"repository" : "git://github.com/ncb000gt/node-elasticsearch.git", | ||
"license" : "MIT", | ||
"homepage" : "http://github.com/ncb000gt/node-elasticsearch", | ||
"bugs" : "http://github.com/ncb000gt/node-elasticsearch/issues", | ||
"devDependencies" : { | ||
"chai" : "*", | ||
"coveralls" : "*", | ||
"jscoverage" : "*", | ||
"jshint" : "*", | ||
"mocha" : "*", | ||
"mocha-lcov-reporter" : "*" | ||
"repository": "git://github.com/ncb000gt/node-elasticsearch.git", | ||
"license": "MIT", | ||
"homepage": "http://github.com/ncb000gt/node-elasticsearch", | ||
"bugs": "http://github.com/ncb000gt/node-elasticsearch/issues", | ||
"devDependencies": { | ||
"chai": "~1.7.2", | ||
"coveralls": "~2.0.16", | ||
"jscoverage": "~0.3.7", | ||
"jshint": "~2.1.4", | ||
"mocha": "~1.12.0", | ||
"mocha-lcov-reporter": "0.0.1" | ||
}, | ||
"scripts" : { | ||
"coverage" : "rm -rf ./reports ; mkdir -p ./reports ; NODE_ELASTICSEARCH_COVERAGE=true mocha -R html-cov -r ./test/common.js -u bdd ./test/lib > reports/coverage.html", | ||
"pretest" : "jshint *.js ./lib/*.js ./test/*.js ; jscoverage ./lib ./lib-cov", | ||
"test" : "mocha --check-leaks -R spec -r ./test/common.js -u bdd ./test/lib", | ||
"posttest" : "NODE_ELASTICSEARCH_COVERAGE=true mocha -R mocha-lcov-reporter -r ./test/common.js -u bdd ./test/lib | ./node_modules/coveralls/bin/coveralls.js" | ||
"scripts": { | ||
"coverage": "rm -rf ./reports ; mkdir -p ./reports ; NODE_ELASTICSEARCH_COVERAGE=true mocha -R html-cov -r ./test/common.js -u bdd ./test/lib > reports/coverage.html", | ||
"pretest": "jshint *.js ./lib/*.js ./test/*.js ; jscoverage ./lib ./lib-cov", | ||
"test": "mocha --check-leaks -R spec -r ./test/common.js -u bdd ./test/lib", | ||
"posttest": "NODE_ELASTICSEARCH_COVERAGE=true mocha -R mocha-lcov-reporter -r ./test/common.js -u bdd ./test/lib | ./node_modules/coveralls/bin/coveralls.js" | ||
} | ||
} |
@@ -91,3 +91,3 @@ # node-elasticsearch | ||
```Javascript | ||
var config = | ||
var config = { | ||
// optional - when not supplied, defaults to the following: | ||
@@ -94,0 +94,0 @@ server : { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126204
3546