UNPKG
@drip_sync/drip
Version:
latest (0.2.0)
0.2.0
0.1.0
0.0.1
Scalable incremental sync for MongoDB aggregation pipelines
@drip_sync/drip
/
dist
/
cea
/
strip_to_gate.js
8 lines
(7 loc)
•
274 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
"use strict"
;
Object
.
defineProperty
(
exports
,
"__esModule"
, {
value
:
true
});
exports
.
stripToGate
= stripToGate;
function
stripToGate
(
pipeline
) {
const
lastMatchIndex = pipeline.
map
(
(
s
) =>
s.
type
).
lastIndexOf
(
"match"
);
return
pipeline.
slice
(
0
, lastMatchIndex +
1
); }