ampersand-sync
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -113,13 +113,15 @@ /*$AMPERSAND_VERSION*/ | ||
var request = options.xhr = options.xhrImplementation(ajaxSettings, function (err, resp, body) { | ||
if (err && options.error) return options.error(resp, 'error', err.message); | ||
// Parse body as JSON if a string. | ||
if (body && typeof body === 'string') { | ||
try { | ||
body = JSON.parse(body); | ||
} catch (err) { | ||
if (options.error) return options.error(resp, 'error', err.message); | ||
if (err) { | ||
if (options.error) return options.error(resp, 'error', err.message); | ||
} else { | ||
// Parse body as JSON if a string. | ||
if (body && typeof body === 'string') { | ||
try { | ||
body = JSON.parse(body); | ||
} catch (err) { | ||
if (options.error) return options.error(resp, 'error', err.message); | ||
} | ||
} | ||
if (options.success) return options.success(body, 'success', resp); | ||
} | ||
if (options.success) return options.success(body, 'success', resp); | ||
}); | ||
@@ -126,0 +128,0 @@ model.trigger('request', model, request, options, ajaxSettings); |
{ | ||
"name": "ampersand-sync", | ||
"description": "Provides sync behavior for updating data from ampersand models and collections to the server.", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -6,0 +6,0 @@ "files": [ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
9804
111
0