From 1dbf3934dac8cc8b90169ec4096edcc9f4aa8605 Mon Sep 17 00:00:00 2001 From: yamiteru Date: Sat, 1 Apr 2023 16:13:50 +0200 Subject: [PATCH] Format and lint --- benchmarks/and.ts | 10 +++++----- benchmarks/filter.ts | 2 +- benchmarks/map.ts | 2 +- benchmarks/or.ts | 10 +++++----- benchmarks/resolve.ts | 6 ++++-- examples/1-map.ts | 2 +- examples/2-filter.ts | 2 +- examples/3-or.ts | 2 +- examples/4-wrap.ts | 6 +++--- examples/5-parse.ts | 2 +- examples/6-resolve.ts | 19 +++++++++++-------- src/sync/map.ts | 2 +- 12 files changed, 35 insertions(+), 30 deletions(-) diff --git a/benchmarks/and.ts b/benchmarks/and.ts index 6b668dc..d98c65d 100644 --- a/benchmarks/and.ts +++ b/benchmarks/and.ts @@ -1,11 +1,11 @@ -import {err, ok} from "elfs"; +import { err, ok } from "elfs"; import { suite, useTerminal } from "isitfast"; -import {error} from "../src"; -import {and} from "../src/sync"; +import { error } from "../src"; +import { and } from "../src/sync"; const pipuAnd = and( - (v: number) => v > 0.2 ? ok(v * 2) : err(error("TEST1")(v)), - (v: number) => v < 0.8 ? ok(v * 2) : err(error("TEST2")(v)), + (v: number) => (v > 0.2 ? ok(v * 2) : err(error("TEST1")(v))), + (v: number) => (v < 0.8 ? ok(v * 2) : err(error("TEST2")(v))), ); const test = suite("and", { diff --git a/benchmarks/filter.ts b/benchmarks/filter.ts index fb3bc66..4bc08da 100644 --- a/benchmarks/filter.ts +++ b/benchmarks/filter.ts @@ -1,5 +1,5 @@ import { suite, useTerminal } from "isitfast"; -import {filter} from "../src/sync"; +import { filter } from "../src/sync"; const pipuFilter = filter((v: number) => !(v % 2)); diff --git a/benchmarks/map.ts b/benchmarks/map.ts index eb305d7..211b121 100644 --- a/benchmarks/map.ts +++ b/benchmarks/map.ts @@ -1,5 +1,5 @@ import { suite, useTerminal } from "isitfast"; -import {map} from "../src/sync"; +import { map } from "../src/sync"; const pipuMap = map((v: number) => v * 2); diff --git a/benchmarks/or.ts b/benchmarks/or.ts index b7bcd27..860c3a0 100644 --- a/benchmarks/or.ts +++ b/benchmarks/or.ts @@ -1,11 +1,11 @@ -import {err, ok} from "elfs"; +import { err, ok } from "elfs"; import { suite, useTerminal } from "isitfast"; -import {error} from "../src"; -import {or} from "../src/sync"; +import { error } from "../src"; +import { or } from "../src/sync"; const pipuOr = or( - (v: number) => v > 0.2 ? ok(v * 2) : err(error("TEST1")(v)), - (v: number) => v < 0.8 ? ok(v * 2) : err(error("TEST2")(v)), + (v: number) => (v > 0.2 ? ok(v * 2) : err(error("TEST1")(v))), + (v: number) => (v < 0.8 ? ok(v * 2) : err(error("TEST2")(v))), ); const test = suite("or", { diff --git a/benchmarks/resolve.ts b/benchmarks/resolve.ts index 95f110d..3094a04 100644 --- a/benchmarks/resolve.ts +++ b/benchmarks/resolve.ts @@ -1,7 +1,9 @@ import { suite, useTerminal } from "isitfast"; -import {resolve} from "../src/async"; +import { resolve } from "../src/async"; -const pipuResolve = resolve((v: number) => new Promise((resolve) => resolve(v))); +const pipuResolve = resolve( + (v: number) => new Promise((resolve) => resolve(v)), +); const test = suite("resolve", { pipu_resolve: async () => { diff --git a/examples/1-map.ts b/examples/1-map.ts index c5d4bb8..b876b5a 100644 --- a/examples/1-map.ts +++ b/examples/1-map.ts @@ -1,4 +1,4 @@ -import {and, map} from "../src/sync"; +import { and, map } from "../src/sync"; export const doubleToString = and( map((v: number) => v * 2), diff --git a/examples/2-filter.ts b/examples/2-filter.ts index 8f3fcd0..44a9e13 100644 --- a/examples/2-filter.ts +++ b/examples/2-filter.ts @@ -1,4 +1,4 @@ -import {and, filter} from "../src/sync"; +import { and, filter } from "../src/sync"; export const ageFilter = and( filter((v: number) => v >= 1), diff --git a/examples/3-or.ts b/examples/3-or.ts index f091ea4..ff51282 100644 --- a/examples/3-or.ts +++ b/examples/3-or.ts @@ -1,4 +1,4 @@ -import {filter, or} from "../src/sync"; +import { filter, or } from "../src/sync"; export const tenOrTwenty = or( filter((v: number) => v === 10), diff --git a/examples/4-wrap.ts b/examples/4-wrap.ts index cc9abc6..2df638b 100644 --- a/examples/4-wrap.ts +++ b/examples/4-wrap.ts @@ -1,7 +1,7 @@ -import {error} from "../src"; -import {filter, wrap} from "../src/sync"; +import { error } from "../src"; +import { filter, wrap } from "../src/sync"; export const adultFilter = wrap( filter((age: number) => age >= 18), - error("AGE_IS_NOT_ADULT") + error("AGE_IS_NOT_ADULT"), ); diff --git a/examples/5-parse.ts b/examples/5-parse.ts index e823a39..0f44da2 100644 --- a/examples/5-parse.ts +++ b/examples/5-parse.ts @@ -1,4 +1,4 @@ -import {map, parse} from "../src/sync"; +import { map, parse } from "../src/sync"; export const double = map((v: number) => v * 2); diff --git a/examples/6-resolve.ts b/examples/6-resolve.ts index 7aba07c..43a99a7 100644 --- a/examples/6-resolve.ts +++ b/examples/6-resolve.ts @@ -1,11 +1,14 @@ -import {and, resolve} from "../src/async"; +import { and, resolve } from "../src/async"; export const getUser = and( - resolve((email: string) => new Promise((resolve) => { - resolve({ - email, - name: "John Doe", - age: 18, - }); - })), + resolve( + (email: string) => + new Promise((resolve) => { + resolve({ + email, + name: "John Doe", + age: 18, + }); + }), + ), ); diff --git a/src/sync/map.ts b/src/sync/map.ts index 339feeb..110c78d 100644 --- a/src/sync/map.ts +++ b/src/sync/map.ts @@ -1,6 +1,6 @@ import { Result, ok, err } from "elfs"; import { Error, PipeableSync } from "../types"; -import {error} from "../utils"; +import { error } from "../utils"; /** * Sync pipeable which maps value from `$Input` to `Ok<$Output>`.