UNPKG

@speakr/speakr-module-services

Version:
28 lines (24 loc) 585 B
'use strict'; module.exports = { publicData }; function publicData(options) { // 1. Get the users base object let users = options.users; let networks = options.networks; let agencies = options.agencies; // 2. Delete the options users delete options.users; // 3. Reset the options users options.users = { fname: users.first_name, lname: users.last_name, id_hash: users.id_hash, email: users.email, active: users.active, networks: networks, agencies: agencies }; // 4. Return the options variable return Promise.resolve(options); }