Skip to content

Commit

Permalink
release: 2.1.1
Browse files Browse the repository at this point in the history
* bump release to 2.1.1.
* modify iterable partition to use filter and predicate
  • Loading branch information
baetheus committed Mar 18, 2024
1 parent eae5565 commit 0dd2bc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@baetheus/fun",
"version": "2.1.0",
"version": "2.1.1",
"exports": {
"./applicable": "./applicable.ts",
"./array": "./array.ts",
Expand Down
18 changes: 4 additions & 14 deletions iterable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import { isSome } from "./option.ts";
import { isLeft, isRight } from "./either.ts";
import { createBind, createTap } from "./flatmappable.ts";
import { createBindTo } from "./mappable.ts";
import { pipe } from "./fn.ts";
import { not } from "./predicate.ts";

/**
* @since 2.0.0
Expand Down Expand Up @@ -260,20 +262,8 @@ export function partition<A>(
return (ua) => {
const cloned = clone(ua);
return [
iterable(function* partitionFirst() {
for (const a of cloned) {
if (predicate(a)) {
yield a;
}
}
}),
iterable(function* partitionSecond() {
for (const a of cloned) {
if (!predicate(a)) {
yield a;
}
}
}),
pipe(cloned, filter(predicate)),
pipe(cloned, filter(not(predicate))),
];
};
}
Expand Down

0 comments on commit 0dd2bc1

Please sign in to comment.