Comparing version 0.5.24 to 0.5.25
@@ -15,7 +15,8 @@ /** | ||
var lodash = { | ||
isFunction: require('lodash/lang/isFunction'), | ||
forEach: require('lodash/collection/forEach'), | ||
merge: require('lodash/object/merge'), | ||
noop: require('lodash/utility/noop'), | ||
pick: require('lodash/object/pick') | ||
isFunction: require('lodash/isFunction'), | ||
forEach: require('lodash/forEach'), | ||
merge: require('lodash/merge'), | ||
noop: require('lodash/noop'), | ||
pickBy: require('lodash/pickBy'), | ||
pick: require('lodash/pick') | ||
}; | ||
@@ -46,7 +47,11 @@ var DEFAULT_GUID = 'g0'; | ||
* @param {Object} context context object | ||
* @param {Function} picker picker function for lodash/object/pick | ||
* @param {Function|Array|String} picker picker object w/iteratee for lodash/pickBy|pick | ||
* @param {String} method method name, get or post | ||
*/ | ||
function pickContext (context, picker, method) { | ||
return picker && picker[method] ? lodash.pick(context, picker[method]) : context; | ||
if (picker && picker[method]) { | ||
var libPicker = lodash.isFunction(picker[method]) ? lodash.pickBy : lodash.pick; | ||
return libPicker(context, picker[method]); | ||
} | ||
return context; | ||
} | ||
@@ -102,3 +107,3 @@ | ||
* @memberof Request | ||
* @param {Object} body The JSON object that contains the resource data being updated for this request. | ||
* @param {Object} body The JSON object that contains the resource data being updated for this request. | ||
* Not used for read and delete operations. | ||
@@ -140,4 +145,4 @@ * @chainable | ||
if (result.meta) { | ||
self.options._serviceMeta.push(result.meta) | ||
}; | ||
self.options._serviceMeta.push(result.meta); | ||
} | ||
return result; | ||
@@ -248,3 +253,3 @@ }); | ||
}); | ||
}; | ||
} | ||
@@ -327,3 +332,3 @@ /** | ||
.clientConfig(clientConfig) | ||
.end(callback) | ||
.end(callback); | ||
}, | ||
@@ -354,3 +359,3 @@ | ||
.clientConfig(clientConfig) | ||
.end(callback) | ||
.end(callback); | ||
}, | ||
@@ -383,3 +388,3 @@ | ||
.clientConfig(clientConfig) | ||
.end(callback) | ||
.end(callback); | ||
}, | ||
@@ -410,3 +415,3 @@ | ||
.clientConfig(clientConfig) | ||
.end(callback) | ||
.end(callback); | ||
}, | ||
@@ -413,0 +418,0 @@ |
@@ -9,5 +9,5 @@ /** | ||
var lodash = { | ||
forEach: require('lodash/collection/forEach'), | ||
isArray: require('lodash/lang/isArray'), | ||
isObject: require('lodash/lang/isObject') | ||
forEach: require('lodash/forEach'), | ||
isArray: require('lodash/isArray'), | ||
isObject: require('lodash/isObject') | ||
}; | ||
@@ -14,0 +14,0 @@ |
@@ -17,6 +17,6 @@ /** | ||
var _ = { | ||
forEach: require('lodash/collection/forEach'), | ||
some: require('lodash/collection/some'), | ||
delay: require('lodash/function/delay'), | ||
isNumber: require('lodash/lang/isNumber') | ||
forEach: require('lodash/forEach'), | ||
some: require('lodash/some'), | ||
delay: require('lodash/delay'), | ||
isNumber: require('lodash/isNumber') | ||
}, | ||
@@ -205,3 +205,3 @@ DEFAULT_CONFIG = { | ||
if (err) { | ||
// getting detail info from xhr module | ||
// getting detail info from xhr module | ||
err.rawRequest = resp.rawRequest; | ||
@@ -208,0 +208,0 @@ err.url = resp.url; |
{ | ||
"name": "fetchr", | ||
"version": "0.5.24", | ||
"version": "0.5.25", | ||
"description": "Fetchr augments Flux applications by allowing Flux stores to be used on server and client to fetch data", | ||
@@ -27,3 +27,3 @@ "main": "index.js", | ||
"fumble": "^0.1.0", | ||
"lodash": "^3.3.0", | ||
"lodash": "^4.0.1", | ||
"object-assign": "^4.0.1", | ||
@@ -30,0 +30,0 @@ "xhr": "^2.0.0" |
@@ -378,3 +378,3 @@ # Fetchr | ||
`contextPicker` follows the same format as the `predicate` parameter in [`lodash/object/pick`](https://lodash.com/docs#pick) with three arguments: `(value, key, object)`. | ||
`contextPicker` follows the same format as the `predicate` parameter in [`lodash/pickBy`](https://lodash.com/docs#pickBy) with two arguments: `(value, key)`. | ||
@@ -388,3 +388,3 @@ ```js | ||
contextPicker: { | ||
GET: function (value, key, object) { | ||
GET: function (value, key) { | ||
// for example, if you don't enable CSRF protection for GET, you are able to ignore it with the url | ||
@@ -394,3 +394,3 @@ if (key === '_csrf') { | ||
} | ||
rerurn true; | ||
return true; | ||
} | ||
@@ -397,0 +397,0 @@ // for other method e.g., POST, if you don't define the picker, it will pick the entire context object |
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
65057
1269
+ Addedlodash@4.17.21(transitive)
- Removedlodash@3.10.1(transitive)
Updatedlodash@^4.0.1