Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tempo-std

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tempo-std - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

15

CHANGELOG.json

@@ -5,2 +5,17 @@ {

{
"version": "0.5.0",
"tag": "tempo-std_v0.5.0",
"date": "Sun, 16 Feb 2020 03:58:19 GMT",
"comments": {
"minor": [
{
"comment": "Put subject first in Validation functions"
},
{
"comment": "Add `match` functions"
}
]
}
},
{
"version": "0.4.0",

@@ -7,0 +22,0 @@ "tag": "tempo-std_v0.4.0",

10

CHANGELOG.md
# Change Log - tempo-std
This log was last generated on Sun, 16 Feb 2020 00:01:24 GMT and should not be manually modified.
This log was last generated on Sun, 16 Feb 2020 03:58:19 GMT and should not be manually modified.
## 0.5.0
Sun, 16 Feb 2020 03:58:19 GMT
### Minor changes
- Put subject first in Validation functions
- Add `match` functions
## 0.4.0

@@ -6,0 +14,0 @@ Sun, 16 Feb 2020 00:01:24 GMT

@@ -12,2 +12,3 @@ import { Maybe } from './maybe';

export declare function forEach<A, Err>(result: AsyncResult<A, Err>, f: (a: A) => void): void;
export declare function match<A, B, Err, Prog = unknown>(result: AsyncResult<A, Err, Prog>, f: (a: A) => B, fErr: (e: Err) => B, notAsked: B, fProg: (p: Prog) => B): B;
export declare function map<A, B, Err, Prog>(async: AsyncResult<A, Err, Prog>, f: (a: A) => B): AsyncResult<B, Err, Prog>;

@@ -14,0 +15,0 @@ export declare function mapN<A, B, C, Err, Prog>(a: AsyncResult<A, Err, Prog>, b: AsyncResult<B, Err, Prog>, f: Fun2<A, B, C>): AsyncResult<C, Err, Prog>;

@@ -44,2 +44,13 @@ /*

}
export function match(result, f, fErr, notAsked, fProg) {
switch (result.kind) {
case 'Loading': return fProg(result.progress);
case 'NotAsked': return notAsked;
case 'Outcome':
switch (result.value.kind) {
case 'Success': return f(result.value.value);
case 'Failure': return fErr(result.value.error);
}
}
}
export function map(async, f) {

@@ -46,0 +57,0 @@ return mapA(async, function (r) { return mapR(r, f); });

@@ -19,2 +19,3 @@ import { Maybe } from './maybe';

export declare function loading<T, P>(progress: P): Async<T, P>;
export declare function match<A, B, Prog = unknown>(result: Async<A, Prog>, f: (a: A) => B, notAsked: B, fProg: (p: Prog) => B): B;
export declare function map<A, B, P>(async: Async<A, P>, f: (a: A) => B): Async<B, P>;

@@ -21,0 +22,0 @@ export declare function mapLoading<A, E1, E2>(async: Async<A, E1>, f: (e: E1) => E2): Async<A, E2>;

@@ -19,2 +19,9 @@ /*

export function loading(progress) { return { kind: 'Loading', progress: progress }; }
export function match(result, f, notAsked, fProg) {
switch (result.kind) {
case 'Loading': return fProg(result.progress);
case 'NotAsked': return notAsked;
case 'Outcome': return f(result.value);
}
}
export function map(async, f) {

@@ -21,0 +28,0 @@ switch (async.kind) {

@@ -65,2 +65,3 @@ import { Maybe } from './maybe';

export declare function flatten<T, E>(result: Result<Result<T, E>, E>): Result<T, E>;
export declare function match<A, B, Err>(result: Result<A, Err>, f: (a: A) => B, fErr: (e: Err) => B): B;
export declare function cata<A, B, Err>(result: Result<A, Err>, f: (a: A) => B, ifNone: B): B;

@@ -67,0 +68,0 @@ export declare function cataLazy<A, B, Err>(result: Result<A, Err>, f: (a: A) => B, ifNone: () => B): B;

@@ -267,2 +267,8 @@ /*

}
export function match(result, f, fErr) {
switch (result.kind) {
case 'Success': return f(result.value);
case 'Failure': return fErr(result.error);
}
}
export function cata(result, f, ifNone) {

@@ -269,0 +275,0 @@ switch (result.kind) {

37

es6/validation.d.ts

@@ -9,20 +9,21 @@ import { Fun2, Fun3, Fun4, Fun5, Fun6 } from './types/functions';

export declare function ofNullable<T, E>(value: T | undefined | null, error: E): Validation<T, E>;
export declare function apN<A, B, C, Err>(f: Validation<Fun2<A, B, C>, Err>, a: Validation<A, Err>, b: Validation<B, Err>): Validation<C, Err>;
export declare function apN<A, B, C, D, Err>(f: Validation<Fun3<A, B, C, D>, Err>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>): Validation<D, Err>;
export declare function apN<A, B, C, D, E, Err>(f: Validation<Fun4<A, B, C, D, E>, Err>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>): Validation<E, Err>;
export declare function apN<A, B, C, D, E, F, Err>(f: Validation<Fun5<A, B, C, D, E, F>, Err>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>): Validation<F, Err>;
export declare function apN<A, B, C, D, E, F, G, Err>(f: Validation<Fun6<A, B, C, D, E, F, G>, Err>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>): Validation<G, Err>;
export declare function mapError<A, E1, E2>(f: (e: E1) => E2, result: Validation<A, E1>): Validation<A, E2>;
export declare function mapN<A, B, C, Err>(f: Fun2<A, B, C>, a: Validation<A, Err>, b: Validation<B, Err>): Validation<C, Err>;
export declare function mapN<A, B, C, D, Err>(f: Fun3<A, B, C, D>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>): Validation<D, Err>;
export declare function mapN<A, B, C, D, E, Err>(f: Fun4<A, B, C, D, E>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>): Validation<E, Err>;
export declare function mapN<A, B, C, D, E, F, Err>(f: Fun5<A, B, C, D, E, F>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>): Validation<F, Err>;
export declare function mapN<A, B, C, D, E, F, G, Err>(f: Fun6<A, B, C, D, E, F, G>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>): Validation<G, Err>;
export declare function flatMapN<A, B, C, Err>(f: Fun2<A, B, Validation<C, Err>>, a: Validation<A, Err>, b: Validation<B, Err>): Validation<C, Err>;
export declare function flatMapN<A, B, C, D, Err>(f: Fun3<A, B, C, Validation<D, Err>>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>): Validation<D, Err>;
export declare function flatMapN<A, B, C, D, E, Err>(f: Fun4<A, B, C, D, Validation<E, Err>>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>): Validation<E, Err>;
export declare function flatMapN<A, B, C, D, E, F, Err>(f: Fun5<A, B, C, D, E, Validation<F, Err>>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>): Validation<F, Err>;
export declare function flatMapN<A, B, C, D, E, F, G, Err>(f: Fun6<A, B, C, D, E, F, Validation<G, Err>>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>): Validation<G, Err>;
export declare function filter<T, E>(predicate: (v: T) => boolean, error: E, result: Validation<T, E>): Validation<T, E>;
export declare function filterLazy<T, E>(predicate: (v: T) => boolean, errorf: () => E, result: Validation<T, E>): Validation<T, E>;
export declare function match<A, B, E>(value: Validation<A, E>, f: (v: A) => B, fErr: (e: Nel<E>) => B): B;
export declare function apN<A, B, C, Err>(a: Validation<A, Err>, b: Validation<B, Err>, f: Validation<Fun2<A, B, C>, Err>): Validation<C, Err>;
export declare function apN<A, B, C, D, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, f: Validation<Fun3<A, B, C, D>, Err>): Validation<D, Err>;
export declare function apN<A, B, C, D, E, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, f: Validation<Fun4<A, B, C, D, E>, Err>): Validation<E, Err>;
export declare function apN<A, B, C, D, E, F, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, f: Validation<Fun5<A, B, C, D, E, F>, Err>): Validation<F, Err>;
export declare function apN<A, B, C, D, E, F, G, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>, f: Validation<Fun6<A, B, C, D, E, F, G>, Err>): Validation<G, Err>;
export declare function mapError<A, E1, E2>(result: Validation<A, E1>, f: (e: E1) => E2): Validation<A, E2>;
export declare function mapN<A, B, C, Err>(a: Validation<A, Err>, b: Validation<B, Err>, f: Fun2<A, B, C>): Validation<C, Err>;
export declare function mapN<A, B, C, D, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, f: Fun3<A, B, C, D>): Validation<D, Err>;
export declare function mapN<A, B, C, D, E, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, f: Fun4<A, B, C, D, E>): Validation<E, Err>;
export declare function mapN<A, B, C, D, E, F, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, f: Fun5<A, B, C, D, E, F>): Validation<F, Err>;
export declare function mapN<A, B, C, D, E, F, G, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>, f: Fun6<A, B, C, D, E, F, G>): Validation<G, Err>;
export declare function flatMapN<A, B, C, Err>(a: Validation<A, Err>, b: Validation<B, Err>, f: Fun2<A, B, Validation<C, Err>>): Validation<C, Err>;
export declare function flatMapN<A, B, C, D, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, f: Fun3<A, B, C, Validation<D, Err>>): Validation<D, Err>;
export declare function flatMapN<A, B, C, D, E, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, f: Fun4<A, B, C, D, Validation<E, Err>>): Validation<E, Err>;
export declare function flatMapN<A, B, C, D, E, F, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, f: Fun5<A, B, C, D, E, Validation<F, Err>>): Validation<F, Err>;
export declare function flatMapN<A, B, C, D, E, F, G, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>, f: Fun6<A, B, C, D, E, F, Validation<G, Err>>): Validation<G, Err>;
export declare function filter<T, E>(result: Validation<T, E>, predicate: (v: T) => boolean, error: E): Validation<T, E>;
export declare function filterLazy<T, E>(result: Validation<T, E>, predicate: (v: T) => boolean, errorf: () => E): Validation<T, E>;
export declare function flatten<T, E>(result: Validation<Validation<T, E>, E>): Validation<T, E>;

@@ -29,0 +30,0 @@ export declare function recover<T, E>(result: Validation<T, E>, whenFailure: T): Res.Result<T, Nel<unknown>>;

@@ -34,10 +34,17 @@ /*

}
export function apN(f) {
export function match(value, f, fErr) {
switch (value.kind) {
case 'Success': return f(value.value);
case 'Failure': return fErr(value.error);
}
}
export function apN() {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var f = args.pop();
return Res.apNWithCombine.apply(Res, __spreadArrays([f, concat], args));
}
export function mapError(f, result) {
export function mapError(result, f) {
switch (result.kind) {

@@ -48,17 +55,19 @@ case 'Failure': return failures(map(result.error, f));

}
export function mapN(f) {
export function mapN() {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var f = args.pop();
return Res.mapNWithCombine.apply(Res, __spreadArrays([f, concat], args));
}
export function flatMapN(f) {
export function flatMapN() {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var f = args.pop();
return Res.flatMapNWithCombine.apply(Res, __spreadArrays([f, concat], args));
}
export function filter(predicate, error, result) {
export function filter(result, predicate, error) {
switch (result.kind) {

@@ -75,3 +84,3 @@ case 'Failure': return result;

}
export function filterLazy(predicate, errorf, result) {
export function filterLazy(result, predicate, errorf) {
switch (result.kind) {

@@ -78,0 +87,0 @@ case 'Failure': return result;

@@ -12,2 +12,3 @@ import { Maybe } from './maybe';

export declare function forEach<A, Err>(result: AsyncResult<A, Err>, f: (a: A) => void): void;
export declare function match<A, B, Err, Prog = unknown>(result: AsyncResult<A, Err, Prog>, f: (a: A) => B, fErr: (e: Err) => B, notAsked: B, fProg: (p: Prog) => B): B;
export declare function map<A, B, Err, Prog>(async: AsyncResult<A, Err, Prog>, f: (a: A) => B): AsyncResult<B, Err, Prog>;

@@ -14,0 +15,0 @@ export declare function mapN<A, B, C, Err, Prog>(a: AsyncResult<A, Err, Prog>, b: AsyncResult<B, Err, Prog>, f: Fun2<A, B, C>): AsyncResult<C, Err, Prog>;

@@ -50,2 +50,14 @@ "use strict";

exports.forEach = forEach;
function match(result, f, fErr, notAsked, fProg) {
switch (result.kind) {
case 'Loading': return fProg(result.progress);
case 'NotAsked': return notAsked;
case 'Outcome':
switch (result.value.kind) {
case 'Success': return f(result.value.value);
case 'Failure': return fErr(result.value.error);
}
}
}
exports.match = match;
function map(async, f) {

@@ -52,0 +64,0 @@ return async_1.map(async, function (r) { return result_1.map(r, f); });

@@ -19,2 +19,3 @@ import { Maybe } from './maybe';

export declare function loading<T, P>(progress: P): Async<T, P>;
export declare function match<A, B, Prog = unknown>(result: Async<A, Prog>, f: (a: A) => B, notAsked: B, fProg: (p: Prog) => B): B;
export declare function map<A, B, P>(async: Async<A, P>, f: (a: A) => B): Async<B, P>;

@@ -21,0 +22,0 @@ export declare function mapLoading<A, E1, E2>(async: Async<A, E1>, f: (e: E1) => E2): Async<A, E2>;

@@ -23,2 +23,10 @@ "use strict";

exports.loading = loading;
function match(result, f, notAsked, fProg) {
switch (result.kind) {
case 'Loading': return fProg(result.progress);
case 'NotAsked': return notAsked;
case 'Outcome': return f(result.value);
}
}
exports.match = match;
function map(async, f) {

@@ -25,0 +33,0 @@ switch (async.kind) {

@@ -65,2 +65,3 @@ import { Maybe } from './maybe';

export declare function flatten<T, E>(result: Result<Result<T, E>, E>): Result<T, E>;
export declare function match<A, B, Err>(result: Result<A, Err>, f: (a: A) => B, fErr: (e: Err) => B): B;
export declare function cata<A, B, Err>(result: Result<A, Err>, f: (a: A) => B, ifNone: B): B;

@@ -67,0 +68,0 @@ export declare function cataLazy<A, B, Err>(result: Result<A, Err>, f: (a: A) => B, ifNone: () => B): B;

@@ -297,2 +297,9 @@ "use strict";

exports.flatten = flatten;
function match(result, f, fErr) {
switch (result.kind) {
case 'Success': return f(result.value);
case 'Failure': return fErr(result.error);
}
}
exports.match = match;
function cata(result, f, ifNone) {

@@ -299,0 +306,0 @@ switch (result.kind) {

@@ -9,20 +9,21 @@ import { Fun2, Fun3, Fun4, Fun5, Fun6 } from './types/functions';

export declare function ofNullable<T, E>(value: T | undefined | null, error: E): Validation<T, E>;
export declare function apN<A, B, C, Err>(f: Validation<Fun2<A, B, C>, Err>, a: Validation<A, Err>, b: Validation<B, Err>): Validation<C, Err>;
export declare function apN<A, B, C, D, Err>(f: Validation<Fun3<A, B, C, D>, Err>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>): Validation<D, Err>;
export declare function apN<A, B, C, D, E, Err>(f: Validation<Fun4<A, B, C, D, E>, Err>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>): Validation<E, Err>;
export declare function apN<A, B, C, D, E, F, Err>(f: Validation<Fun5<A, B, C, D, E, F>, Err>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>): Validation<F, Err>;
export declare function apN<A, B, C, D, E, F, G, Err>(f: Validation<Fun6<A, B, C, D, E, F, G>, Err>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>): Validation<G, Err>;
export declare function mapError<A, E1, E2>(f: (e: E1) => E2, result: Validation<A, E1>): Validation<A, E2>;
export declare function mapN<A, B, C, Err>(f: Fun2<A, B, C>, a: Validation<A, Err>, b: Validation<B, Err>): Validation<C, Err>;
export declare function mapN<A, B, C, D, Err>(f: Fun3<A, B, C, D>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>): Validation<D, Err>;
export declare function mapN<A, B, C, D, E, Err>(f: Fun4<A, B, C, D, E>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>): Validation<E, Err>;
export declare function mapN<A, B, C, D, E, F, Err>(f: Fun5<A, B, C, D, E, F>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>): Validation<F, Err>;
export declare function mapN<A, B, C, D, E, F, G, Err>(f: Fun6<A, B, C, D, E, F, G>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>): Validation<G, Err>;
export declare function flatMapN<A, B, C, Err>(f: Fun2<A, B, Validation<C, Err>>, a: Validation<A, Err>, b: Validation<B, Err>): Validation<C, Err>;
export declare function flatMapN<A, B, C, D, Err>(f: Fun3<A, B, C, Validation<D, Err>>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>): Validation<D, Err>;
export declare function flatMapN<A, B, C, D, E, Err>(f: Fun4<A, B, C, D, Validation<E, Err>>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>): Validation<E, Err>;
export declare function flatMapN<A, B, C, D, E, F, Err>(f: Fun5<A, B, C, D, E, Validation<F, Err>>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>): Validation<F, Err>;
export declare function flatMapN<A, B, C, D, E, F, G, Err>(f: Fun6<A, B, C, D, E, F, Validation<G, Err>>, a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>): Validation<G, Err>;
export declare function filter<T, E>(predicate: (v: T) => boolean, error: E, result: Validation<T, E>): Validation<T, E>;
export declare function filterLazy<T, E>(predicate: (v: T) => boolean, errorf: () => E, result: Validation<T, E>): Validation<T, E>;
export declare function match<A, B, E>(value: Validation<A, E>, f: (v: A) => B, fErr: (e: Nel<E>) => B): B;
export declare function apN<A, B, C, Err>(a: Validation<A, Err>, b: Validation<B, Err>, f: Validation<Fun2<A, B, C>, Err>): Validation<C, Err>;
export declare function apN<A, B, C, D, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, f: Validation<Fun3<A, B, C, D>, Err>): Validation<D, Err>;
export declare function apN<A, B, C, D, E, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, f: Validation<Fun4<A, B, C, D, E>, Err>): Validation<E, Err>;
export declare function apN<A, B, C, D, E, F, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, f: Validation<Fun5<A, B, C, D, E, F>, Err>): Validation<F, Err>;
export declare function apN<A, B, C, D, E, F, G, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>, f: Validation<Fun6<A, B, C, D, E, F, G>, Err>): Validation<G, Err>;
export declare function mapError<A, E1, E2>(result: Validation<A, E1>, f: (e: E1) => E2): Validation<A, E2>;
export declare function mapN<A, B, C, Err>(a: Validation<A, Err>, b: Validation<B, Err>, f: Fun2<A, B, C>): Validation<C, Err>;
export declare function mapN<A, B, C, D, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, f: Fun3<A, B, C, D>): Validation<D, Err>;
export declare function mapN<A, B, C, D, E, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, f: Fun4<A, B, C, D, E>): Validation<E, Err>;
export declare function mapN<A, B, C, D, E, F, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, f: Fun5<A, B, C, D, E, F>): Validation<F, Err>;
export declare function mapN<A, B, C, D, E, F, G, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>, f: Fun6<A, B, C, D, E, F, G>): Validation<G, Err>;
export declare function flatMapN<A, B, C, Err>(a: Validation<A, Err>, b: Validation<B, Err>, f: Fun2<A, B, Validation<C, Err>>): Validation<C, Err>;
export declare function flatMapN<A, B, C, D, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, f: Fun3<A, B, C, Validation<D, Err>>): Validation<D, Err>;
export declare function flatMapN<A, B, C, D, E, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, f: Fun4<A, B, C, D, Validation<E, Err>>): Validation<E, Err>;
export declare function flatMapN<A, B, C, D, E, F, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, f: Fun5<A, B, C, D, E, Validation<F, Err>>): Validation<F, Err>;
export declare function flatMapN<A, B, C, D, E, F, G, Err>(a: Validation<A, Err>, b: Validation<B, Err>, c: Validation<C, Err>, d: Validation<D, Err>, e: Validation<E, Err>, g: Validation<F, Err>, f: Fun6<A, B, C, D, E, F, Validation<G, Err>>): Validation<G, Err>;
export declare function filter<T, E>(result: Validation<T, E>, predicate: (v: T) => boolean, error: E): Validation<T, E>;
export declare function filterLazy<T, E>(result: Validation<T, E>, predicate: (v: T) => boolean, errorf: () => E): Validation<T, E>;
export declare function flatten<T, E>(result: Validation<Validation<T, E>, E>): Validation<T, E>;

@@ -29,0 +30,0 @@ export declare function recover<T, E>(result: Validation<T, E>, whenFailure: T): Res.Result<T, Nel<unknown>>;

@@ -47,11 +47,19 @@ "use strict";

exports.ofNullable = ofNullable;
function apN(f) {
function match(value, f, fErr) {
switch (value.kind) {
case 'Success': return f(value.value);
case 'Failure': return fErr(value.error);
}
}
exports.match = match;
function apN() {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var f = args.pop();
return Res.apNWithCombine.apply(Res, __spreadArrays([f, nel_1.concat], args));
}
exports.apN = apN;
function mapError(f, result) {
function mapError(result, f) {
switch (result.kind) {

@@ -63,19 +71,21 @@ case 'Failure': return failures(nel_1.map(result.error, f));

exports.mapError = mapError;
function mapN(f) {
function mapN() {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var f = args.pop();
return Res.mapNWithCombine.apply(Res, __spreadArrays([f, nel_1.concat], args));
}
exports.mapN = mapN;
function flatMapN(f) {
function flatMapN() {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var f = args.pop();
return Res.flatMapNWithCombine.apply(Res, __spreadArrays([f, nel_1.concat], args));
}
exports.flatMapN = flatMapN;
function filter(predicate, error, result) {
function filter(result, predicate, error) {
switch (result.kind) {

@@ -93,3 +103,3 @@ case 'Failure': return result;

exports.filter = filter;
function filterLazy(predicate, errorf, result) {
function filterLazy(result, predicate, errorf) {
switch (result.kind) {

@@ -96,0 +106,0 @@ case 'Failure': return result;

@@ -6,3 +6,3 @@ {

"description": "Std library for TypeScript. Natural complement to the tempo libs.",
"version": "0.4.0",
"version": "0.5.0",
"keywords": [

@@ -9,0 +9,0 @@ "tempo",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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