| import restArguments from './restArguments.js'; | |
| import isFunction from './isFunction.js'; | |
| import map from './map.js'; | |
| import deepGet from './_deepGet.js'; | |
| import toPath from './_toPath.js'; | |
| // Invoke a method (with arguments) on every item in a collection. | |
| export default 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); | |
| }); | |
| }); | |
Xet Storage Details
- Size:
- 832 Bytes
- Xet hash:
- 2c27eb82156c87e10e774f99b915ba3f1c85f4484ae7329998b7f491db5f94ed
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.