Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995557
negate_stage.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
547 B
Referenced Files
None
Subscribers
None
negate_stage.js
View Options
function
negate_stage
(
stage
)
{
const
negated_stage
=
{};
for
(
let
key
of
Object
.
keys
(
stage
))
{
if
(
key
===
"$or"
)
{
negated_stage
.
$nor
=
stage
[
key
];
}
else
if
(
key
===
"$nor"
)
{
negated_stage
.
$or
=
stage
[
key
];
}
else
if
(
key
===
"$and"
)
{
negated_stage
.
$or
=
stage
[
key
].
map
(
expression
=>
negate_stage
(
expression
)
);
}
else
{
if
(
stage
[
key
].
$not
)
{
negated_stage
[
key
]
=
stage
[
key
].
$not
;
}
else
{
negated_stage
[
key
]
=
{
$not
:
stage
[
key
]
};
}
}
}
return
negated_stage
;
}
module
.
exports
=
negate_stage
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 08:04 (21 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556864
Default Alt Text
negate_stage.js (547 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment