Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update Deno dependencies and typescript version #16

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{

"name": "@myty/promise-chain",
"version": "0.4.5",
"exports": "./mod.ts",
Expand Down
2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export {
assert,
assertEquals,
assertRejects,
} from "https://deno.land/[email protected]/testing/asserts.ts";
} from "https://deno.land/[email protected]/assert/mod.ts";
export {
assertSpyCalls,
spy,
Expand Down
16 changes: 15 additions & 1 deletion promise-chain.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import { PromiseChainable, PromiseChainableConstructor } from "./types.ts";
import type { PromiseChainable, PromiseChainableConstructor } from "./types.ts";

/**
* Utility class to wrap a composition class with the intended purpose of chaining methods, specifically useful for
* functions that return Promises. Note: Promise functions and non-promise functions can be mixed.
*
* ### Example
*
* ```ts
* const testClass = new TestClassWithSyncAndAsyncMethods();
* const result = await PromiseChain(testClass)
.asyncIncrement("propertyOne", 3)
.asyncIncrementTwo()
.asyncIncrementOne()
.increment("propertyTwo", 5)
.increment("propertyOne", 2)
.asyncIncrementOne();
* ```
*
*/
const PromiseChain = function <T extends Record<string, unknown>>(
this: PromiseChainable<T> | void,
Expand Down
2 changes: 1 addition & 1 deletion stubs/test-class.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PickMatching } from "../types.ts";
import type { PickMatching } from "../types.ts";

type PickNumbers<T> = PickMatching<T, number>;

Expand Down
Loading