toPath.js 308 B

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