MCPcopy Create free account
hub / github.com/activejs/activejs / makeUnit

Function makeUnit

packages/core/src/tests/selection.spec.ts:54–65  ·  view source on GitHub ↗
(overrideConfig?: UnitConfig<any>)

Source from the content-addressed store, hash-verified

52 let valueAtPath: any;
53
54 const makeUnit = (overrideConfig?: UnitConfig<any>) => {
55 const unitCtor = selectRandom([DictUnit, ListUnit, GenericUnit]);
56 unitConfig = {
57 ...somewhatValidConfig(configOptions, unitCtor),
58 ...overrideConfig,
59 };
60 unit = new unitCtor(unitConfig);
61 randPath = findRandomPath(unit.value());
62 if (!randPath.length) {
63 randPath = [randomNumOrStr()];
64 }
65 };
66
67 const makeCase = () => {
68 randVal = randomValidValue(unit, 4);

Callers 1

selection.spec.tsFile · 0.85

Calls 5

selectRandomFunction · 0.90
somewhatValidConfigFunction · 0.90
findRandomPathFunction · 0.90
randomNumOrStrFunction · 0.90
valueMethod · 0.45

Tested by

no test coverage detected