Comparing version 0.0.5 to 0.0.6
@@ -126,3 +126,8 @@ /* | ||
} | ||
return '/' + this.name + '/' + encodeURIComponent(docId); | ||
if (docId.indexOf('_design/') === 0) { | ||
return '/' + this.name + '/_design/' + encodeURIComponent(docId.substr(8)); | ||
} else { | ||
return '/' + this.name + '/' + encodeURIComponent(docId); | ||
} | ||
}, | ||
@@ -129,0 +134,0 @@ |
{ | ||
"name": "cot", | ||
"description": "promise-based CouchDB library for node with no surprises (in a good way)", | ||
"description": "promise-based CouchDB library with no surprises (in a good way)", | ||
"keywords": ["couch", "couchdb", "promise", "promises"], | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"main": "cot", | ||
@@ -7,0 +7,0 @@ "dependencies": { |
@@ -7,3 +7,3 @@ # What is Cot? # | ||
- It has clear method names that map almost directly to CouchDB's HTTP API. | ||
- It elminates redundancies in CouchDB's API when there is a clear advantage. | ||
- It takes advantage of redundancies in the CouchDB API to map responses back to promises. | ||
For instance, `post()` treats conflicts as errors, but `put()` treats | ||
@@ -10,0 +10,0 @@ conflicts as a normal state that callers can test for. |
@@ -41,2 +41,14 @@ var chai = require('chai'); | ||
describe('#docUrl', function() { | ||
it('should encode doc ids', function() { | ||
var encoded = db.docUrl('foo/bar'); | ||
expect(encoded).to.equal('/test-cot-node/foo%2Fbar'); | ||
}); | ||
it('should not encode first slash in design doc ids', function() { | ||
var encoded = db.docUrl('_design/foo/bar'); | ||
expect(encoded).to.equal('/test-cot-node/_design/foo%2Fbar'); | ||
}); | ||
}); | ||
describe('#info', function() { | ||
@@ -43,0 +55,0 @@ it('should return database info', function(done) { |
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
20863
460
2