baselinejs
Advanced tools
Comparing version 0.2.2 to 1.0.0
@@ -253,7 +253,7 @@ var _ = require( 'underscore' ); | ||
resolve( returnedJson ); | ||
resolve( true, returnedJson ); | ||
}, | ||
error : function() { | ||
error : function( xhr ) { | ||
if( options.error ) options.error.apply( this, arguments ); | ||
reject.apply( this, arguments ); | ||
resolve( false, xhr ); | ||
} | ||
@@ -286,7 +286,7 @@ } ); | ||
resolve( returnedJson ); | ||
resolve( true, returnedJson ); | ||
}, | ||
error : function() { | ||
error : function( xhr ) { | ||
if( options.error ) options.error.apply( this, arguments ); | ||
reject.apply( this, arguments ); | ||
resolve( false, xhr ); | ||
} | ||
@@ -343,6 +343,6 @@ } ); | ||
if( ! base ) throw new Error( 'A "url" property or function must be specified' ); | ||
if( method == 'create' || _.isArray( recordIdOrIds ) ) return base; | ||
var endpoint = base; | ||
var recordId = recordIdOrIds; | ||
var endpoint = base.replace( /([^\/])$/, '$1/' ) + encodeURIComponent( recordId ); | ||
endpoint = endpoint.replace( /\/:(\w+)/g, function( match, fieldName ) { | ||
@@ -352,2 +352,6 @@ return '/' + _this.get( recordId, fieldName ); | ||
if( method != 'create' && ! _.isArray( recordIdOrIds ) ) { | ||
endpoint = base.replace( /([^\/])$/, '$1/' ) + encodeURIComponent( recordId ); | ||
} | ||
return endpoint; | ||
@@ -388,3 +392,3 @@ }, | ||
_sync : function( url, method, payload, options ) { | ||
_sync : function( url, method, payload, ajaxOptions ) { | ||
var options = _.defaults( {}, options ); | ||
@@ -410,3 +414,3 @@ | ||
// Make the request, allowing the user to override any Ajax options. | ||
var xhr = options.xhr = $.ajax( _.extend( params, options ) ); | ||
var xhr = $.ajax( _.extend( params, ajaxOptions ) ); | ||
return xhr; | ||
@@ -413,0 +417,0 @@ } |
{ | ||
"name": "baselinejs", | ||
"version": "0.2.2", | ||
"version": "1.0.0", | ||
"description": "Share code and data between the client and the server in full stack JavaScript applications.", | ||
@@ -15,3 +15,3 @@ "main": "baseline.js", | ||
"jquery": "^2.1.4", | ||
"node-uuid": "1.4.1", | ||
"node-uuid": "^1.4.1", | ||
"steamer": "~0.2.0", | ||
@@ -18,0 +18,0 @@ "underscore": "^1.8.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
110343
445
2
+ Addednode-uuid@1.4.8(transitive)
- Removednode-uuid@1.4.1(transitive)
Updatednode-uuid@^1.4.1