@convex-dev/aggregate
Version:
Convex component to calculate counts and sums of values for efficient aggregation.
11 lines • 604 B
JavaScript
import { fc } from "@fast-check/vitest";
const objectKeys = "abcdefghijklmnopqrstuvwxyz".split("");
export const arbitraryValue = fc.letrec((tie) => ({
tree: fc.oneof({ depthSize: "small" }, tie("leaf"), tie("obj")),
leaf: fc.oneof(fc.constant(null), fc.boolean(), fc.string(), fc
.float({ noDefaultInfinity: true, noNaN: true })
.filter((f) => f !== 0 || 1 / f > 0)),
obj: fc.dictionary(fc.string({ unit: fc.constantFrom(...objectKeys) }), tie("tree"), { maxKeys: 3 }),
arr: fc.array(tie("tree"), { maxLength: 4 }),
})).tree;
//# sourceMappingURL=arbitrary.helpers.js.map