Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function parseDocumentIncludes(
bodyStream: stream.Stream,
conventions: DocumentConventions) {
return RavenCommandResponsePipeline.create<{ [key: string]: object }>()
.parseJsonAsync([
pick({ filter: "Includes" }),
streamObject()
])
.streamKeyCaseTransform(conventions.entityFieldNameConvention, "DOCUMENT_LOAD")
.collectResult((result, next) => {
result[next["key"]] = next["value"];
return result;
}, {})
.process(bodyStream);
}