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

baselinejs

Package Overview
Dependencies
Maintainers
4
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 8.0.0 to 8.0.1

30

collectionService.js

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

return _this._sync( url, 'delete', recordIdsToDeleteRemotely.length > 1 ? recordIdsToDeleteRemotely : undefined, options.ajax ).then( function( result ) {
return _this._sync( url, 'DELETE', recordIdsToDeleteRemotely.length > 1 ? recordIdsToDeleteRemotely : undefined, options.ajax ).then( function( result ) {
if( result.success ) deleteLocally();

@@ -213,3 +213,3 @@

_.each( newRecordDTOs, function( thisDto ) {
_this._mergeDTO( thisDto, 'get' );
_this._mergeDTO( thisDto );
}, this );

@@ -251,4 +251,4 @@ },

return _this._sync( url, 'get', null, options.ajax ).then( function( result ) {
if( result.success ) _this._mergeDTO( result.data, 'get' );
return _this._sync( url, 'GET', null, options.ajax ).then( function( result ) {
if( result.success ) _this._mergeDTO( result.data );

@@ -268,9 +268,10 @@ return result;

var method = this.isNew( recordId ) ? 'create' : 'update';
var isUpdate = ! this.isNew( recordId );
var url = _this._getRESTEndpoint( method, recordId );
var dto = this._recordToDTO( recordId, method );
return _this._sync( url, method, dto, options.ajax ).then( function( result ) {
return _this._sync( url, isUpdate ? 'PUT' : 'POST', dto, options.ajax ).then( function( result ) {
if( result.success ) {
if( method === 'create' ) _this._newRecordIds = _.without( _this._newRecordIds, recordId );
if( options.merge ) _this._mergeDTO( result.data, method );
if( ! isUpdate ) _this._newRecordIds = _.without( _this._newRecordIds, recordId );
if( options.merge ) _this._mergeDTO( result.data );
}

@@ -369,3 +370,3 @@

_mergeDTO : function( dto, method ) {
_mergeDTO : function( dto ) {
var recordId = dto[ this._idFieldName ];

@@ -389,18 +390,9 @@

_sync : function( url, method, payload, ajaxOptions ) {
_sync : function( url, verb, payload, ajaxOptions ) {
var options = _.defaults( {}, options );
var methodMap = {
'create' : 'POST',
'update' : 'PUT',
'patch' : 'PATCH',
'delete' : 'DELETE',
'get' : 'GET',
'search' : 'SEARCH'
};
// Default JSON-request options.
var params = {
url : url,
type : methodMap[ method ],
type : verb,
dataType : 'json',

@@ -407,0 +399,0 @@ contentType : 'application/json',

{
"name": "baselinejs",
"version": "8.0.0",
"version": "8.0.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