UNPKG

zcatalyst-cli

Version:

Command Line Tool for CATALYST

18 lines (17 loc) 497 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = (req, _RES, next) => { if (req.cookies === undefined) { req.cookies = {}; } const rc = req.headers.cookie; rc && rc.split(';').forEach((cookie) => { const parts = cookie.split('='); const part = parts.shift(); if (part) { req.cookies[part.trim()] = decodeURI(parts.join('=')); } }); next(); };