/** * * @param {String} attrPath * @returns {Array} */ const getEditDisplayAvailableFieldsPath = attrPath => [..._.take(attrPath, attrPath.length -2), 'editDisplay', 'availableFields', attrPath[attrPath.length - 1]]
function* generate(array) { const len = array.length; for (let n = 1; n <= len; n++) { yield [_.take(array, n), _.takeRight(array, len - n)]; } }
// Special handler for the upload relations sameApisUploadRelationsToAdd.forEach(attrPath => { const attr = _.get(schema.models, attrPath); _.set(prevSchema.models, attrPath, attr); const fieldsPath = [..._.take(attrPath, attrPath.length - 2), 'fields']; const currentFields = _.get(prevSchema.models, fieldsPath, []); currentFields.push(attr.name); _.set(prevSchema.models, fieldsPath, currentFields); });
results: _.take(receivedSMSLog.results, query.limit) }]; });
let takeLatestAuction = _.take(auctionsArr, 10) const newAuctions = takeLatestAuction.map(auction => { return Object.assign({}, auction, {
if (bidsLength != 0) { let sortedBids = _.orderBy(bids, ['id'], ['desc']) let lastestTenBids = _.take(sortedBids, 10) let bidHistoryArr = JSON.parse(JSON.stringify(lastestTenBids)) const newBidHistory = bidHistoryArr.map(bid => {
let takeLatestAuction = _.take(auctionsArr, 15) const newAuctions = takeLatestAuction.map(auction => { return Object.assign({}, auction, {
const getEditDisplayFieldsPath = attrPath => [..._.take(attrPath, attrPath.length -2), 'editDisplay', 'fields']
results: _.take(receivedSMS.results, query.limit) }]; });
const getEditDisplayDisplayedField = attrPath => [..._.take(attrPath, attrPath.length -2), 'editDisplay', 'displayedField']