Comparing version 2.1.1 to 2.1.2
@@ -60,6 +60,8 @@ (function () { | ||
for (i = 0, l = matches.length; i < l; i+= 2) { | ||
if(matches) { | ||
for (i = 0, l = matches.length; i < l; i+= 2) { | ||
var key = clean(matches[i]); | ||
var value = matches[i + 1]; | ||
result[key] = value=="NULL"?null:clean(value); | ||
} | ||
} | ||
@@ -66,0 +68,0 @@ if (!callback || callback === null) return result; |
@@ -7,3 +7,3 @@ { | ||
"keywords": ["pg", "postgres", "hstore"], | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"main": "lib/index.js", | ||
@@ -10,0 +10,0 @@ "homepage": "https://github.com/scarney81/pg-hstore", |
@@ -18,3 +18,3 @@ [![Build Status](https://travis-ci.org/scarney81/pg-hstore.png)](https://travis-ci.org/[YOUR_GITHUB_USERNAME]/[YOUR_PROJECT_NAME]) | ||
```javascript | ||
var hstore = require('pg-hstore'); | ||
var hstore = require('pg-hstore')(); | ||
var source = { foo: "oof", bar: "rab", baz: "zab" }; | ||
@@ -31,3 +31,3 @@ hstore.stringify(source, function(result) { | ||
```javascript | ||
var hstore = require('pg-hstore'); | ||
var hstore = require('pg-hstore')(); | ||
var source = '"foo"=>"oof", "bar"=>"rab", "baz"=>"zab"'; | ||
@@ -34,0 +34,0 @@ hstore.parse(source, function(result) { |
@@ -24,2 +24,11 @@ /*globals it, describe, beforeEach */ | ||
it('should hstore parse an empty hstore string', function (done) { | ||
var source = ''; | ||
hstore.parse(source, function (target) { | ||
should.exist(target); | ||
target.should.eql({}); | ||
done(); | ||
}); | ||
}); | ||
it('should hstore parse an hstore string with multiple values', function (done) { | ||
@@ -26,0 +35,0 @@ var source = '"foo"=>"oof","bar"=>"rab","baz"=>"zab"'; |
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
17013
241