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

Move to latest npm dependencies #149

Merged
merged 3 commits into from
Jul 12, 2018
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
22 changes: 12 additions & 10 deletions example/binary-trees/arbitraries/FullBinaryTreeArbitrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ export const fullBinaryTree = (maxDepth: number): fc.Arbitrary<Tree<number>> =>
});
}
const subTree = fullBinaryTree(maxDepth - 1);
return fc.boolean().chain((hasChildren: boolean): fc.Arbitrary<Tree<number>> => {
if (hasChildren) {
return fc.boolean().chain(
(hasChildren: boolean): fc.Arbitrary<Tree<number>> => {
if (hasChildren) {
return fc.record({
value: valueArbitrary,
left: subTree,
right: subTree
});
}
return fc.record({
value: valueArbitrary,
left: subTree,
right: subTree
left: fc.constant(null),
right: fc.constant(null)
});
}
return fc.record({
value: valueArbitrary,
left: fc.constant(null),
right: fc.constant(null)
});
});
);
};
Loading