"use strict";
// Copyright IBM Corp. and LoopBack contributors 2018. All Rights Reserved.
// Node module: @loopback/rest
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamBodyParser = void 0;
const body_parser_helpers_1 = require("./body-parser.helpers");
/**
 * A special body parser to retain request stream as is.
 * It will be used by explicitly setting `x-parser` to `'stream'` in the request
 * body spec.
 */
class StreamBodyParser {
    constructor() {
        this.name = body_parser_helpers_1.builtinParsers.stream;
    }
    supports(mediaType) {
        // Return `false` so that this parser can only be trigged by the
        // `{x-parser: 'stream'}` extension in the request body spec
        return false;
    }
    async parse(request) {
        return { value: request };
    }
}
exports.StreamBodyParser = StreamBodyParser;
//# sourceMappingURL=body-parser.stream.js.map