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

@ahanapediatrics/ahana-fp

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ahanapediatrics/ahana-fp - npm Package Compare versions

Comparing version 2.2.2 to 2.2.3

7

CHANGELOG.md

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

### [2.2.3](https://github.com/ohana-pediatrics/ahana-fp/compare/v2.2.2...v2.2.3) (2020-05-04)
### Bug Fixes
* 🐛 ensure overloading types in Either are declared ([03f9ba1](https://github.com/ohana-pediatrics/ahana-fp/commit/03f9ba1fa7951d0610985aac1ad4e23298372400))
### [2.2.2](https://github.com/ohana-pediatrics/ahana-fp/compare/v2.2.1...v2.2.2) (2020-05-04)

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

4

lib/src/Either.d.ts

@@ -60,4 +60,4 @@ import { Optional } from './Optional';

*/
map<O>(lFunc: (val: L) => O, rFunc: (val: R) => Optional<O>): O;
map<O>(lFunc: (val: L) => O | Optional<O>, rFunc: (val: R) => O | Optional<O>): O;
map<T>(lFunc: (val: L) => T, rFunc: (val: R) => T): T;
/**

@@ -72,2 +72,3 @@ * Map the left-value of one type to a different value of another type.

mapLeft<O>(lFunc: (val: L) => Optional<O>): Either<O, R>;
mapLeft<T>(lFunc: (val: L) => T): Either<T, R>;
/**

@@ -82,2 +83,3 @@ * Map the right-value of one type to a different value of another type.

mapRight<O>(rFunc: (val: R) => Optional<O>): Either<L, O>;
mapRight<T>(rFunc: (val: R) => T): Either<L, T>;
/**

@@ -84,0 +86,0 @@ * Much like `{@link mapLeft}`, this converts an `Either` from one type to another.

@@ -45,3 +45,25 @@ "use strict";

});
it('maps empty to empty', () => {
chai_1.expect(Optional_1.Optional.empty()
.map(x => x)
.isPresent()).to.be.false;
});
});
describe('#filter', () => {
it('filters an Optional to the same value if the filter matches', () => {
chai_1.expect(Optional_1.Optional.of(2)
.filter(x => x === 2)
.get()).to.equal(2);
});
it('filters an Optional to empty if the filter does not match', () => {
chai_1.expect(Optional_1.Optional.of(2)
.filter(x => x !== 2)
.isPresent()).to.be.false;
});
it('filters empty to empty', () => {
chai_1.expect(Optional_1.Optional.empty()
.filter(x => true)
.isPresent()).to.be.false;
});
});
});
{
"name": "@ahanapediatrics/ahana-fp",
"version": "2.2.2",
"version": "2.2.3",
"description": "FP-friendly classes for Typescript",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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