Skip to content

Commit

Permalink
Merge branch 'billjohnston-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ConcurrentHashMap authored and ConcurrentHashMap committed Feb 15, 2016
2 parents aad3a84 + b21e357 commit b8f98f9
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "restangular",
"version": "1.5.1",
"version": "1.5.2",
"main": "./dist/restangular.js",
"description": "Restful Resources service for AngularJS apps",
"repository": {
Expand All @@ -16,4 +16,4 @@
"components",
"lib"
]
}
}
14 changes: 7 additions & 7 deletions dist/restangular.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Restful Resources service for AngularJS apps
* @version v1.4.0 - 2015-04-03 * @link https://github.com/mgonto/restangular
* @version v1.5.2 - 2016-02-08 * @link https://github.com/mgonto/restangular
* @author Martin Gontovnikas <[email protected]>
* @license MIT License, http://www.opensource.org/licenses/MIT
*/(function() {
Expand All @@ -18,7 +18,7 @@ restangular.provider('Restangular', function() {
*/
var safeMethods= ['get', 'head', 'options', 'trace', 'getlist'];
config.isSafe = function(operation) {
return _.contains(safeMethods, operation.toLowerCase());
return _.includes(safeMethods, operation.toLowerCase());
};

var absolutePattern = /^https?:\/\//i;
Expand Down Expand Up @@ -395,7 +395,7 @@ restangular.provider('Restangular', function() {
object.setParentless = function(values) {
if (_.isArray(values)) {
config.shouldSaveParent = function(route) {
return !_.contains(values, route);
return !_.includes(values, route);
};
} else if (_.isBoolean(values)) {
config.shouldSaveParent = function() {
Expand Down Expand Up @@ -1165,9 +1165,9 @@ restangular.provider('Restangular', function() {
var fullParams = response.config.params;
var elem = parseResponse(resData, operation, route, fetchUrl, response, deferred);
if (elem) {

var data;
if (operation === 'post' && !__this[config.restangularFields.restangularCollection]) {
var data = restangularizeElem(
data = restangularizeElem(
__this[config.restangularFields.parentResource],
elem,
route,
Expand All @@ -1177,7 +1177,7 @@ restangular.provider('Restangular', function() {
);
resolvePromise(deferred, response, data, filledObject);
} else {
var data = restangularizeElem(
data = restangularizeElem(
__this[config.restangularFields.parentResource],
elem,
__this[config.restangularFields.route],
Expand Down Expand Up @@ -1312,7 +1312,7 @@ restangular.provider('Restangular', function() {
serv.getList = _.bind(collection.getList, collection);

for (var prop in collection) {
if (collection.hasOwnProperty(prop) && _.isFunction(collection[prop]) && !_.contains(knownCollectionMethods, prop)) {
if (collection.hasOwnProperty(prop) && _.isFunction(collection[prop]) && !_.includes(knownCollectionMethods, prop)) {
serv[prop] = _.bind(collection[prop], collection);
}
}
Expand Down
4 changes: 2 additions & 2 deletions dist/restangular.min.js

Large diffs are not rendered by default.

Binary file modified dist/restangular.zip
Binary file not shown.
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "restangular",
"description": "Restful Resources service for AngularJS apps",
"version": "1.5.1",
"version": "1.5.2",
"filename": "restangular.min.js",
"main": "./dist/restangular.min.js",
"homepage": "https://github.com/mgonto/restangular",
Expand Down Expand Up @@ -32,24 +32,25 @@
"lodash": ">=1.3.0"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-bower": "*",
"grunt-bower-task": "*",
"grunt-cli": ">= 0.1.7",
"grunt-contrib-concat": "*",
"grunt-contrib-jshint": "*",
"grunt-contrib-uglify": "*",
"grunt-bower": "*",
"grunt-bower-task": "*",
"grunt-karma": "latest",
"grunt-conventional-changelog": "0.0.12",
"grunt-karma": "latest",
"grunt-zip": "*",
"karma": "~0.12.1",
"karma-mocha-reporter": "0.2.8",
"karma-jasmine": "~0.1.5",
"karma": "^0.13.19",
"karma-chrome-launcher": "~0.1.2",
"karma-phantomjs-launcher": "~0.1.2",
"karma-firefox-launcher": "~0.1.3"
"karma-firefox-launcher": "~0.1.3",
"karma-jasmine": "~0.1.5",
"karma-mocha-reporter": "0.2.8",
"karma-phantomjs-launcher": "~0.1.2"
},
"scripts": {
"test": "grunt test --verbose"
},
"license": "MIT"
}
}
12 changes: 6 additions & 6 deletions src/restangular.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ restangular.provider('Restangular', function() {
*/
var safeMethods= ['get', 'head', 'options', 'trace', 'getlist'];
config.isSafe = function(operation) {
return _.contains(safeMethods, operation.toLowerCase());
return _.includes(safeMethods, operation.toLowerCase());
};

var absolutePattern = /^https?:\/\//i;
Expand Down Expand Up @@ -390,7 +390,7 @@ restangular.provider('Restangular', function() {
object.setParentless = function(values) {
if (_.isArray(values)) {
config.shouldSaveParent = function(route) {
return !_.contains(values, route);
return !_.includes(values, route);
};
} else if (_.isBoolean(values)) {
config.shouldSaveParent = function() {
Expand Down Expand Up @@ -1160,9 +1160,9 @@ restangular.provider('Restangular', function() {
var fullParams = response.config.params;
var elem = parseResponse(resData, operation, route, fetchUrl, response, deferred);
if (elem) {

var data;
if (operation === 'post' && !__this[config.restangularFields.restangularCollection]) {
var data = restangularizeElem(
data = restangularizeElem(
__this[config.restangularFields.parentResource],
elem,
route,
Expand All @@ -1172,7 +1172,7 @@ restangular.provider('Restangular', function() {
);
resolvePromise(deferred, response, data, filledObject);
} else {
var data = restangularizeElem(
data = restangularizeElem(
__this[config.restangularFields.parentResource],
elem,
__this[config.restangularFields.route],
Expand Down Expand Up @@ -1307,7 +1307,7 @@ restangular.provider('Restangular', function() {
serv.getList = _.bind(collection.getList, collection);

for (var prop in collection) {
if (collection.hasOwnProperty(prop) && _.isFunction(collection[prop]) && !_.contains(knownCollectionMethods, prop)) {
if (collection.hasOwnProperty(prop) && _.isFunction(collection[prop]) && !_.includes(knownCollectionMethods, prop)) {
serv[prop] = _.bind(collection[prop], collection);
}
}
Expand Down

0 comments on commit b8f98f9

Please sign in to comment.