New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hyper-ts-session

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyper-ts-session - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [0.1.2](https://github.com/thewilkybarkid/hyper-ts-session/compare/v0.1.1...v0.1.2) (2022-05-25)
### Features
* end the current session ([afbcfcf](https://github.com/thewilkybarkid/hyper-ts-session/commit/afbcfcf0a787271ea0e6e9b0dd5ff179695935d2))
### [0.1.1](https://github.com/thewilkybarkid/hyper-ts-session/compare/v0.1.0...v0.1.1) (2022-05-24)

@@ -7,0 +14,0 @@

@@ -29,1 +29,8 @@ import * as J from 'fp-ts/Json';

export declare function storeSession(session: JsonRecord): ReaderMiddleware<SessionEnv, HeadersOpen, HeadersOpen, never, void>;
/**
* Returns a middleware that ends the current session.
*
* @category constructors
* @since 0.1.2
*/
export declare function endSession(): ReaderMiddleware<SessionEnv, HeadersOpen, HeadersOpen, never, void>;

19

dist/index.js

@@ -38,3 +38,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.storeSession = exports.getSession = void 0;
exports.endSession = exports.storeSession = exports.getSession = void 0;
/**

@@ -77,2 +77,14 @@ * @since 0.1.0

exports.storeSession = storeSession;
/**
* Returns a middleware that ends the current session.
*
* @category constructors
* @since 0.1.2
*/
function endSession() {
return (0, function_1.pipe)(RM.clearCookie('session', {
httpOnly: true,
}), RM.chain(() => currentSessionId()), RM.chainReaderTaskK(deleteSession), RM.orElseW(() => RM.right(undefined)));
}
exports.endSession = endSession;
// -------------------------------------------------------------------------------------

@@ -94,2 +106,7 @@ // utils

}
function deleteSession(key) {
return (0, function_1.flow)(TE.tryCatchK(({ sessionStore }) => __awaiter(this, void 0, void 0, function* () {
yield sessionStore.delete(key);
}), function_1.constVoid), TE.toUnion);
}
function getCookie(name) {

@@ -96,0 +113,0 @@ return (0, function_1.pipe)(getCookies(), M.chainEitherKW(E.fromOptionK(() => 'no-cookie')(r.lookup(name))), M.mapLeft(() => 'no-cookie'));

2

package.json
{
"name": "hyper-ts-session",
"description": "hyper-ts middleware for sessions.",
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/thewilkybarkid/hyper-ts-session",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc