@newdash/newdash
Version:
javascript/typescript utility library
19 lines (18 loc) • 816 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// @ts-nocheck
const map_1 = __importDefault(require("./map"));
const copyArray_1 = __importDefault(require("./.internal/copyArray"));
const isSymbol_1 = __importDefault(require("./isSymbol"));
const stringToPath_1 = __importDefault(require("./.internal/stringToPath"));
const toKey_1 = __importDefault(require("./.internal/toKey"));
function toPath(value) {
if (Array.isArray(value)) {
return (0, map_1.default)(value, toKey_1.default);
}
return (0, isSymbol_1.default)(value) ? [value] : (0, copyArray_1.default)((0, stringToPath_1.default)(value));
}
exports.default = toPath;