Socket
Socket
Sign inDemoInstall

fp-toolkit

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fp-toolkit - npm Package Compare versions

Comparing version 1.2.3 to 1.3.0

7

CHANGELOG.md

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

## [1.3.0](https://github.com/fp-toolkit/fp-toolkit/compare/v1.2.3...v1.3.0) (2023-03-30)
### Features
* **AsyncResult:** add tee and teeErr fns ([3309d63](https://github.com/fp-toolkit/fp-toolkit/commit/3309d635eecb5b4b8d84e4114a1adcf8276c950d))
### [1.2.3](https://github.com/fp-toolkit/fp-toolkit/compare/v1.2.2...v1.2.3) (2023-03-28)

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

2

package.json

@@ -22,3 +22,3 @@ {

],
"version": "1.2.3",
"version": "1.3.0",
"main": "./src/index.ts",

@@ -25,0 +25,0 @@ "scripts": {

@@ -302,2 +302,36 @@ /**

/**
* Execute an arbitrary side-effect on the inner `Ok` value of an `AsyncResult`
* within a pipeline of functions. Useful for logging and debugging. Passes
* the inner value through unchanged. Sometimes referred to as `do` or `tap`.
*
* The side-effect will be invoked once the underlying `Promise` has resolved.
*
* @param f The side-effect to execute. Should not mutate its arguments.
* @returns The `AsyncResult`, unchanged.
*
* @group Utils
*/
export const tee =
<A>(f: (a: A) => void) =>
<E>(async: AsyncResult<A, E>): AsyncResult<A, E> =>
Async.tee<Result<A, E>>(Result.tee(f))(async)
/**
* Execute an arbitrary side-effect on the inner `Err` value of an `AsyncResult`
* within a pipeline of functions. Useful for logging and debugging. Passes
* the inner value through unchanged. Sometimes referred to as `do` or `tap`.
*
* The side-effect will be invoked once the underlying `Promise` has resolved.
*
* @param f The side-effect to execute. Should not mutate its arguments.
* @returns The `AsyncResult`, unchanged.
*
* @group Utils
*/
export const teeErr =
<E>(f: (a: E) => void) =>
<A>(async: AsyncResult<A, E>): AsyncResult<A, E> =>
Async.tee<Result<A, E>>(Result.teeErr(f))(async)
/* c8 ignore start */

@@ -320,3 +354,5 @@ /** @ignore */

start,
tee,
teeErr,
}
/* c8 ignore end */
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