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

baselinejs

Package Overview
Dependencies
Maintainers
2
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baselinejs - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

33

collectionService.js

@@ -11,11 +11,11 @@ var _ = require( 'underscore' );

options = _.defaults( {}, options, {
idFieldName : "id"
idFieldName : 'id'
} );
if( _.isUndefined( this.collectionName ) ) throw new Error( 'The collectionName attribute must be defined on collection service instances.' );
//if( _.isUndefined( this.fieldNames ) ) throw new Error( 'The fieldNames attribute must be defined on data service instances.' );
// if( _.isUndefined( this.fieldNames ) ) throw new Error( 'The fieldNames attribute must be defined on data service instances.' );
this.length = 0;
//this._fieldNames = this.fieldNames;
// this._fieldNames = this.fieldNames;
this._recordIds = [];

@@ -113,4 +113,4 @@ this._recordsById = {};

// but jury is still out, so we will do it this way for now. nevermind, don't like this, let's keep things explicit. only way
// to add a column is through merge, or
//if( _.isUndefined( this._recordsById[ recordId ][ fieldName ] ) ) throw new Error( 'Field \'' + fieldName + '\' not present for record id ' + recordId + ' in table \'' + this.collectionName + '\'.' );
// to add a column is through merge, or
// if( _.isUndefined( this._recordsById[ recordId ][ fieldName ] ) ) throw new Error( 'Field \'' + fieldName + '\' not present for record id ' + recordId + ' in table \'' + this.collectionName + '\'.' );
this._recordsById[ recordId ][ fieldName ] = this._copyFieldValue( fieldValue );

@@ -253,12 +253,17 @@

this._sync( url, method, dto, {
success : function( returnedJson ) {
if( method === 'create' ) _this._newRecordIds = _.without( _this._newRecordIds, recordId );
return new Promise( function( resolve, reject ) {
_this._sync( url, method, dto, {
success : function( returnedJson ) {
if( method === 'create' ) _this._newRecordIds = _.without( _this._newRecordIds, recordId );
if( options.merge ) _this._mergeDTO( returnedJson, method );
if( options.success ) options.success.apply( this, arguments );
},
error : function() {
if( options.error ) options.error.apply( this, arguments );
}
if( options.merge ) _this._mergeDTO( returnedJson, method );
if( options.success ) options.success.apply( this, arguments );
resolve( returnedJson );
},
error : function() {
if( options.error ) options.error.apply( this, arguments );
reject.apply( this, arguments );
}
} );
} );

@@ -265,0 +270,0 @@ },

{
"name": "baselinejs",
"version": "0.2.0",
"version": "0.2.1",
"description": "Share code and data between the client and the server in full stack JavaScript applications.",

@@ -5,0 +5,0 @@ "main": "baseline.js",

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