UNPKG
react-facebook-next
Version:
latest (4.1.7)
4.1.7
4.1.6
4.1.5
4.1.4
4.1.3
4.1.2
Facebook components like a Login button, Like, Share, Comments or Embedded Post
react-facebook-next
/
src
/
utils
/
clearUndefinedProperties.js
17 lines
(13 loc)
•
296 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export
default
function
clearUndefinedProperties
(
obj
) {
if
(!obj) {
return
obj; }
const
newObj = {};
Object
.
keys
(obj).
forEach
(
(
propertyName
) =>
{
const
value = obj[propertyName];
if
(value !==
undefined
) { newObj[propertyName] = value; } });
return
newObj; }