toPath.js 304 B

123456789101112
  1. define(['./underscore', './isArray'], function (underscore, isArray) {
  2. // Normalize a (deep) property `path` to array.
  3. // Like `_.iteratee`, this function can be customized.
  4. function toPath(path) {
  5. return isArray(path) ? path : [path];
  6. }
  7. underscore.toPath = toPath;
  8. return toPath;
  9. });