UNPKG
pallies
Version:
latest (0.10.0)
0.10.0
0.9.1
0.9.0
0.8.3
0.8.2
0.8.1
0.7.3-rc.0
0.7.2
0.7.2-2
0.7.2-1
0.7.2-0
0.7.1-0
0.7.0
0.6.0
0.5.1
0.5.0
0.4.0
0.3.12
0.3.11
0.3.10
0.3.9
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.0
0.1.1
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Robust user management for Hapi
github.com/frxnz/pallies
frxnz/pallies
pallies
/
lib
/
helpers
/
utils.js
13 lines
(8 loc)
•
270 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict'
;
exports
.
present
=
(
payload,
from
) =>
{
if
(
Array
.
isArray
(payload)) {
return
payload.
map
(
(
p
) =>
this
.
present
(p)); }
const
pick
= (
collect, key
) =>
Object
.
assign
(collect, { [key]: payload[key] });
return
from
.
reduce
(pick, {}); };