Skip to content

Commit

Permalink
Implement fix for Result.combine
Browse files Browse the repository at this point in the history
  • Loading branch information
supermacro committed Apr 17, 2023
1 parent 9a08cba commit b69874e
Show file tree
Hide file tree
Showing 6 changed files with 624 additions and 3 deletions.
13 changes: 13 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"types": "dist/index.d.ts",
"scripts": {
"test": "jest && npm run test-types",
"test-types": "tsc --noEmit ./tests/typecheck-tests.ts",
"test-types": "tsc --noEmit -p ./tests/tsconfig.tests.json",
"lint": "eslint ./src --ext .ts",
"format": "prettier --write 'src/**/*.ts?(x)' && npm run lint -- --fix",
"typecheck": "tsc --noEmit",
Expand Down Expand Up @@ -43,6 +43,7 @@
"rollup-plugin-typescript2": "^0.32.1",
"testdouble": "3.16.3",
"ts-jest": "27.1.5",
"ts-toolbelt": "9.6.0",
"tslib": "^2.4.0",
"typescript": "4.7.2"
},
Expand Down
31 changes: 30 additions & 1 deletion src/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,35 @@ type Prev = [
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
...0[]
]

Expand All @@ -354,7 +383,7 @@ type Prev = [
// T - The array of the results
// Collected - The collected tuples.
// Depth - The maximum depth.
type CollectResults<T, Collected extends unknown[] = [], Depth extends number = 5> = [
type CollectResults<T, Collected extends unknown[] = [], Depth extends number = 50> = [
Depth,
] extends [never]
? []
Expand Down
26 changes: 26 additions & 0 deletions tests/tsconfig.tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"target": "es2016",
"module": "ES2015",
"noImplicitAny": true,
"sourceMap": false,
"downlevelIteration": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"declaration": true,
"moduleResolution": "Node",
"baseUrl": "./src",
"lib": [
"dom",
"es2016",
"es2017.object"
],
"outDir": "dist",
},
"include": [
"./index.test.ts",
"./typecheck-tests.ts"
],
}
Loading

0 comments on commit b69874e

Please sign in to comment.