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

ampersand-sync

Package Overview
Dependencies
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-sync - npm Package Compare versions

Comparing version 3.0.3 to 3.0.4

.travis.yml

17

ampersand-sync.js
/*$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.

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