ampersand-sync
Advanced tools
Comparing version 3.0.3 to 3.0.4
/*$AMPERSAND_VERSION*/ | ||
var _ = require('underscore'); | ||
var result = require("lodash.result"); | ||
var defaults = require("lodash.defaults"); | ||
var contains = require("lodash.contains"); | ||
var assign = require("lodash.assign"); | ||
var xhr = require('xhr'); | ||
@@ -18,3 +21,3 @@ var qs = require('qs'); | ||
// Default options, unless specified. | ||
_.defaults(options || (options = {}), { | ||
defaults(options || (options = {}), { | ||
emulateHTTP: false, | ||
@@ -31,3 +34,3 @@ emulateJSON: false, | ||
if (!options.url) { | ||
options.url = _.result(model, 'url') || urlError(); | ||
options.url = result(model, 'url') || urlError(); | ||
} | ||
@@ -43,3 +46,3 @@ | ||
// make sure we've got a '?' | ||
options.url += _.contains(options.url, '?') ? '&' : '?'; | ||
options.url += contains(options.url, '?') ? '&' : '?'; | ||
options.url += qs.stringify(options.data); | ||
@@ -70,7 +73,7 @@ } | ||
// Start setting ajaxConfig options (headers, xhrFields). | ||
var ajaxConfig = (_.result(model, 'ajaxConfig') || {}); | ||
var ajaxConfig = (result(model, 'ajaxConfig') || {}); | ||
// Combine generated headers with user's headers. | ||
if (ajaxConfig.headers) { | ||
_.extend(headers, ajaxConfig.headers); | ||
assign(headers, ajaxConfig.headers); | ||
} | ||
@@ -101,3 +104,3 @@ params.headers = headers; | ||
var ajaxSettings = _.extend(params, options); | ||
var ajaxSettings = assign(params, options); | ||
@@ -104,0 +107,0 @@ // Make the request. The callback executes functions that are compatible |
{ | ||
"name": "ampersand-sync", | ||
"description": "Provides sync behavior for updating data from ampersand models and collections to the server.", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -16,4 +16,7 @@ "browserify": { | ||
"ampersand-version": "^1.0.0", | ||
"lodash.assign": "^3.0.0", | ||
"lodash.contains": "^2.4.1", | ||
"lodash.defaults": "^3.1.0", | ||
"lodash.result": "^3.0.0", | ||
"qs": "^2.2.4", | ||
"underscore": "~1.6.0", | ||
"xhr": "^1.10.0" | ||
@@ -20,0 +23,0 @@ }, |
@@ -13,3 +13,3 @@ # ampersand-sync | ||
This should have been a major release both for this module and it's dependents (ampersand-model, ampersand-rest-collection, ampersand-collection-rest-mixin), but unfortunately we made a mistake and published as 1.0.2, and were too slow to rollback our mistake before workarounds were in place. | ||
This should have been a major release both for this module and its dependents (ampersand-model, ampersand-rest-collection, ampersand-collection-rest-mixin), but unfortunately we made a mistake and published as 1.0.2, and were too slow to rollback our mistake before workarounds were in place. | ||
@@ -16,0 +16,0 @@ As such we are leaving the current 1.0.x versions in place, but deprecated, and suggest people upgrade to the latest versions of model/collection when they can which will contain the new implementation of xhr. |
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
17305
9
325
7
+ Addedlodash.assign@^3.0.0
+ Addedlodash.contains@^2.4.1
+ Addedlodash.defaults@^3.1.0
+ Addedlodash.result@^3.0.0
+ Addedlodash._baseassign@3.2.0(transitive)
+ Addedlodash._basebind@2.4.1(transitive)
+ Addedlodash._basecopy@3.0.1(transitive)
+ Addedlodash._basecreate@2.4.1(transitive)
+ Addedlodash._basecreatecallback@2.4.1(transitive)
+ Addedlodash._basecreatewrapper@2.4.1(transitive)
+ Addedlodash._baseget@3.7.2(transitive)
+ Addedlodash._baseindexof@2.4.1(transitive)
+ Addedlodash._baseslice@3.0.3(transitive)
+ Addedlodash._bindcallback@3.0.1(transitive)
+ Addedlodash._createassigner@3.1.1(transitive)
+ Addedlodash._createwrapper@2.4.1(transitive)
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash._isiterateecall@3.0.9(transitive)
+ Addedlodash._isnative@2.4.1(transitive)
+ Addedlodash._objecttypes@2.4.1(transitive)
+ Addedlodash._setbinddata@2.4.1(transitive)
+ Addedlodash._shimkeys@2.4.1(transitive)
+ Addedlodash._slice@2.4.1(transitive)
+ Addedlodash._topath@3.8.1(transitive)
+ Addedlodash.assign@3.2.0(transitive)
+ Addedlodash.bind@2.4.1(transitive)
+ Addedlodash.contains@2.4.3(transitive)
+ Addedlodash.defaults@3.1.2(transitive)
+ Addedlodash.forown@2.4.1(transitive)
+ Addedlodash.identity@2.4.1(transitive)
+ Addedlodash.isarguments@3.1.0(transitive)
+ Addedlodash.isarray@2.4.13.0.4(transitive)
+ Addedlodash.isfunction@2.4.13.0.9(transitive)
+ Addedlodash.isobject@2.4.1(transitive)
+ Addedlodash.isstring@2.4.1(transitive)
+ Addedlodash.keys@2.4.13.1.2(transitive)
+ Addedlodash.noop@2.4.1(transitive)
+ Addedlodash.restparam@3.6.1(transitive)
+ Addedlodash.result@3.1.2(transitive)
+ Addedlodash.support@2.4.1(transitive)
- Removedunderscore@~1.6.0
- Removedunderscore@1.6.0(transitive)