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 3.0.3 to 3.1.0

5

lib/src/AsyncData.d.ts

@@ -72,2 +72,6 @@ import { Optional } from '.';

/**
* Check whether the data errored out
*/
isErrored(): boolean;
/**
* Checks whether the data that was loaded is empty.

@@ -108,2 +112,3 @@ *

orElse(v: D | readonly D[]): typeof v;
append(v: D[]): AsyncData<D>;
/**

@@ -110,0 +115,0 @@ * Standard response for mapping this AsyncData to a new one

@@ -124,2 +124,8 @@ "use strict";

/**
* Check whether the data errored out
*/
isErrored() {
return this.is(RemoteDataStatus.Failed);
}
/**
* Checks whether the data that was loaded is empty.

@@ -198,2 +204,6 @@ *

}
append(v) {
const currentData = this.containsData() ? this.internal.getRight() : [];
return AsyncData.loaded(currentData.concat(v));
}
/**

@@ -200,0 +210,0 @@ * Standard response for mapping this AsyncData to a new one

@@ -161,2 +161,26 @@ "use strict";

});
describe('.append', () => {
it('returns a loaded value, if called on a not asked', () => {
const ad = AsyncData_1.AsyncData.notAsked();
chai_1.expect(ad.isLoaded()).to.be.false;
const newAd = ad.append([1]);
chai_1.expect(newAd.isLoaded()).to.be.true;
chai_1.expect(newAd.value()).to.deep.equal([1]);
});
it('returns a loaded value, if called on an error', () => {
const ad = AsyncData_1.AsyncData.errored(new Error());
chai_1.expect(ad.isErrored()).to.be.true;
const newAd = ad.append([1]);
chai_1.expect(newAd.isErrored()).to.be.false;
chai_1.expect(newAd.value()).to.deep.equal([1]);
});
it('returns an updated value', () => {
const ad = AsyncData_1.AsyncData.loaded([1]);
chai_1.expect(ad.isLoaded()).to.be.true;
chai_1.expect(ad.value()).to.deep.equal([1]);
const newAd = ad.append([2]);
chai_1.expect(newAd.isLoaded()).to.be.true;
chai_1.expect(newAd.value()).to.deep.equal([1, 2]);
});
});
});

2

package.json
{
"name": "@ahanapediatrics/ahana-fp",
"version": "3.0.3",
"version": "3.1.0",
"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