Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 3x 3x 3x 23x 23x 1x 22x | import { retrieve } from './registry';
import { generate } from '../generate';
import { BlueprintConstantProperties } from './blueprint';
/**
* Returns a mock from a previously registered `Blueprint`
*/
export function from<T>(name: string, withDefaults?: BlueprintConstantProperties<T>): T {
const blueprint = retrieve(name);
if (!blueprint) {
throw new Error(`Cannot find blueprint for name ${name}`);
}
return generate<T>(blueprint, withDefaults);
}
|