123456789101112131415161718192021 |
- var isArray = require('./isArray'),
- isKey = require('./_isKey'),
- stringToPath = require('./_stringToPath'),
- toString = require('./toString');
- function castPath(value, object) {
- if (isArray(value)) {
- return value;
- }
- return isKey(value, object) ? [value] : stringToPath(toString(value));
- }
- module.exports = castPath;
|