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

sails-disk

Package Overview
Dependencies
Maintainers
3
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-disk - npm Package Compare versions

Comparing version 0.10.4 to 0.10.5

40

lib/database.js

@@ -190,3 +190,3 @@ /**

schema: self.schema,
counters: self.schema
counters: self.counters
});

@@ -207,2 +207,9 @@

// Cast values when reading off of disk. Essentially, unserialize the records.
for (var collectionName in state.data) {
state.data[collectionName].map(function (values) {
self.collections[collectionName]._cast.run(values);
});
}
self.data = state.data;

@@ -506,15 +513,26 @@ self.schema = state.schema;

var attrDef = this.schema[collectionName][attrName];
// Only apply autoIncrement if value is not specified
// Only apply autoIncrement if we're supposed to!
if(!attrDef.autoIncrement) continue;
if(values[attrName]) continue;
// Set Initial Counter Value to 0 for this attribute if not set
// Set initial counter value to 0 for this attribute if not set
if(!this.counters[collectionName][attrName]) this.counters[collectionName][attrName] = 0;
// Increment AI counter
this.counters[collectionName][attrName]++;
// Set data to current auto-increment value
values[attrName] = this.counters[collectionName][attrName];
// If peeps are manually setting the AI field, keep the counter ahead.
// Otherwise, increment the counter and set the field.
if(values[attrName]) {
if (values[attrName] > this.counters[collectionName][attrName]) {
this.counters[collectionName][attrName] = values[attrName];
}
} else {
// Increment AI counter
this.counters[collectionName][attrName]++;
// Set data to current auto-increment value
values[attrName] = this.counters[collectionName][attrName];
}
}

@@ -521,0 +539,0 @@

{
"name": "sails-disk",
"version": "0.10.4",
"version": "0.10.5",
"description": "Persistent local-disk adapter for Sails.js / Waterline",

@@ -32,7 +32,7 @@ "main": "lib/adapter.js",

"lodash": "~2.4.1",
"waterline-criteria": "~0.10.7",
"waterline-criteria": "~0.11.0",
"waterline-errors": "~0.10.0",
"fs-extra": "~0.8.1",
"async": "~0.2.9",
"waterline-cursor": "~0.0.3"
"waterline-cursor": "~0.0.5"
},

@@ -39,0 +39,0 @@ "devDependencies": {

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