UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

26 lines (25 loc) 851 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const get_1 = __importDefault(require("../get")); /** * The base implementation of `at` without support for individual paths. * * @private * @param {Object} object The object to iterate over. * @param {(string|number)[]} paths The property paths to pick. * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { let index = -1; const length = paths.length; const result = Array(length); const skip = object == null; while (++index < length) { result[index] = skip ? undefined : (0, get_1.default)(object, paths[index]); } return result; } exports.default = baseAt;