Skip to content

Commit

Permalink
WIP: typescript types are working, jest refuses
Browse files Browse the repository at this point in the history
  • Loading branch information
danielo515 committed Jul 3, 2024
1 parent ff8b6be commit 4131100
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 63 deletions.
86 changes: 38 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"license": "MIT",
"devDependencies": {
"@stylistic/eslint-plugin": "^1.4.1",
"@tsconfig/svelte": "^5.0.2",
"@tsconfig/svelte": "^5.0.4",
"@types/jest": "^29.5.6",
"@types/node": "^16.11.6",
"@typescript-eslint/eslint-plugin": "^6.7.0",
Expand All @@ -33,12 +33,12 @@
"prettier": "^3.0.3",
"prettier-plugin-svelte": "^3.0.3",
"svelte": "^4.2.0",
"svelte-check": "^3.5.2",
"svelte-check": "^3.8.4",
"svelte-preprocess": "^5.0.4",
"ts-jest": "^29.1.1",
"ts-jest": "^29.1.5",
"ts-node": "^10.9.1",
"tslib": "2.4.0",
"typescript": "^5.2.2",
"typescript": "^5.5.3",
"yaml": "^2.3.3"
},
"dependencies": {
Expand Down
12 changes: 6 additions & 6 deletions src/core/template/templateParser.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as R from "fp-ts/Record";
import { Either, O, pipe } from "@std";
import * as A from "fp-ts/Array";
import * as E from "fp-ts/Either";
import * as R from "fp-ts/Record";
import { absurd, identity } from "fp-ts/function";
import * as St from "fp-ts/string";
import { stringifyYaml } from "obsidian";
import * as P from "parser-ts/Parser";
import * as C from "parser-ts/char";
import * as S from "parser-ts/string";
import * as A from "fp-ts/Array";
import { Either, O, pipe } from "@std";
import { TemplateText, TemplateVariable, FrontmatterCommand } from "./templateSchema";
import { absurd, identity } from "fp-ts/function";
import { ModalFormData } from "../FormResult";
import { stringifyYaml } from "obsidian";
import type { FrontmatterCommand, TemplateText, TemplateVariable } from "./templateSchema";
type Token = TemplateText | TemplateVariable | FrontmatterCommand;
export type ParsedTemplate = Token[];

Expand Down
6 changes: 2 additions & 4 deletions src/std/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ export type ParsingFn<S extends BaseSchema> = (
* Concatenates two parsing functions that return Either<ValiError, B> into one.
* If the first function returns a Right, the second function is not called.
*/
class _EFunSemigroup<A extends BaseSchema, B extends BaseSchema>
implements Semigroup<ParsingFn<A>>
{
concat(f: ParsingFn<A>, g: ParsingFn<B>): (i: unknown) => Either<ValiError, unknown> {
class _EFunSemigroup<A extends BaseSchema> implements Semigroup<ParsingFn<A>> {
concat(f: ParsingFn<A>, g: ParsingFn<A>): (i: unknown) => Either<ValiError, unknown> {
return (i) => {
const fRes = f(i);
if (isRight(fRes)) return fRes;
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
]
},
"include": [
"src/**/*"
"src/**/*",
"jest.config.ts"
]
}

0 comments on commit 4131100

Please sign in to comment.