Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pouchdb

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pouchdb - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

package.json

@@ -5,3 +5,3 @@ {

"author": "Dale Harvey",
"version": "0.0.4",
"version": "0.0.5",
"main": "./src/pouch.js",

@@ -8,0 +8,0 @@ "homepage": "https://github.com/daleharvey/pouchdb",

@@ -953,3 +953,6 @@ // While most of the IDB behaviors match between implementations a

IdbPouch.valid = function idb_valid() {
return !!window.indexedDB;
if (!document.location.host) {
console.warn('indexedDB cannot be used in pages served from the filesystem');
}
return !!window.indexedDB && !!document.location.host;
};

@@ -956,0 +959,0 @@

@@ -93,2 +93,7 @@ var Pouch = this.Pouch = function Pouch(name, opts, callback) {

},
RESERVED_ID: {
status: 400,
error: 'bad_request',
reason: 'Only reserved document ids may start with underscore.'
},
UNKNOWN_ERROR: {

@@ -95,0 +100,0 @@ status: 500,

@@ -42,2 +42,12 @@ // Pretty dumb name for a function, just wraps callback calls so we dont

// Determine id an ID is valid
// - invalid IDs begin with an underescore that does not begin '_design' or '_local'
// - any other string value is a valid id
var isValidId = function(id) {
if (/^_/.test(id)) {
return /^_(design|local)/.test(id);
}
return true;
}
// Preprocess documents, parse their revisions, assign an id and a

@@ -118,2 +128,5 @@ // revision for new writes that are missing them, etc

}
else if (!isValidId(doc._id)) {
error = Pouch.Errors.RESERVED_ID;
}

@@ -332,2 +345,6 @@

}
if (options.auth) {
var token = btoa(options.auth.username + ':' + options.auth.password);
options.headers['Authorization'] = 'Basic ' + token;
}

@@ -334,0 +351,0 @@ return request(options, function(err, response, body) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc