Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9338185
index.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
index.js
View Options
"use strict"
;
var
_typeof
=
typeof
Symbol
===
"function"
&&
typeof
Symbol
.
iterator
===
"symbol"
?
function
(
obj
)
{
return
typeof
obj
;
}
:
function
(
obj
)
{
return
obj
&&
typeof
Symbol
===
"function"
&&
obj
.
constructor
===
Symbol
&&
obj
!==
Symbol
.
prototype
?
"symbol"
:
typeof
obj
;
};
/**
* iterateObject
* Iterates an object. Note the object field order may differ.
*
* @name iterateObject
* @function
* @param {Object} obj The input object.
* @param {Function} fn A function that will be called with the current value, field name and provided object.
* @return {Function} The `iterateObject` function.
*/
function
iterateObject
(
obj
,
fn
)
{
var
i
=
0
,
keys
=
[];
if
(
Array
.
isArray
(
obj
))
{
for
(;
i
<
obj
.
length
;
++
i
)
{
if
(
fn
(
obj
[
i
],
i
,
obj
)
===
false
)
{
break
;
}
}
}
else
if
((
typeof
obj
===
"undefined"
?
"undefined"
:
_typeof
(
obj
))
===
"object"
&&
obj
!==
null
)
{
keys
=
Object
.
keys
(
obj
);
for
(;
i
<
keys
.
length
;
++
i
)
{
if
(
fn
(
obj
[
keys
[
i
]],
keys
[
i
],
obj
)
===
false
)
{
break
;
}
}
}
}
module
.
exports
=
iterateObject
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 4 2025, 8:36 AM (7 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3351398
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment