UNPKG

@creamapi/cream

Version:

Concise REST API Maker - An extension library for express to create REST APIs faster

34 lines (33 loc) 1.25 kB
"use strict"; /* * Copyright 2025 Raul Radu * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ResponseCookieManager = void 0; const HeaderBuilder_1 = require("../Headers/HeaderBuilder"); /** * This class is a header builder that handles Cookie instances instead of pure string */ class ResponseCookieManager extends HeaderBuilder_1.HeaderBuilder { /** * This method overrides the base behavior of HeaderBuilder in order * to return an array of strings for the Set-Cookie header * @returns */ toConcreteHeader() { return this.map((cookie) => cookie.bakeCookie()); } } exports.ResponseCookieManager = ResponseCookieManager;