"use strict"; const cbor = require("cbor"); const fromNodeStream = require("@promistream/from-node-stream"); module.exports = function createDecodeCBORStream(options) { // This is suboptimal; ideally we would call the relevant decoding functions directly, instead of wrapping a Node stream. However, the cbor library does not seem to expose the necessary low-level functions to implement this. let decoder = new cbor.Decoder(options); return fromNodeStream(decoder); };