| define(['./restArguments', './isFunction', './map', './_deepGet', './_toPath'], function (restArguments, isFunction, map, _deepGet, _toPath) { | |
| // Invoke a method (with arguments) on every item in a collection. | |
| var invoke = restArguments(function(obj, path, args) { | |
| var contextPath, func; | |
| if (isFunction(path)) { | |
| func = path; | |
| } else { | |
| path = _toPath(path); | |
| contextPath = path.slice(0, -1); | |
| path = path[path.length - 1]; | |
| } | |
| return map(obj, function(context) { | |
| var method = func; | |
| if (!method) { | |
| if (contextPath && contextPath.length) { | |
| context = _deepGet(context, contextPath); | |
| } | |
| if (context == null) return void 0; | |
| method = context[path]; | |
| } | |
| return method == null ? method : method.apply(context, args); | |
| }); | |
| }); | |
| return invoke; | |
| }); | |
Xet Storage Details
- Size:
- 852 Bytes
- Xet hash:
- 9a4d7a44730209c58b90f1483575a3be06a45ef8b92826d099f565d12b901245
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.