UNPKG

fast-check

Version:

Property based testing framework for JavaScript (like QuickCheck)

9 lines (8 loc) 523 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildCharacterArbitrary = buildCharacterArbitrary; const integer_1 = require("../../integer"); const IndexToCharString_1 = require("../mappers/IndexToCharString"); function buildCharacterArbitrary(min, max, mapToCode, unmapFromCode) { return (0, integer_1.integer)({ min, max }).map((n) => (0, IndexToCharString_1.indexToCharStringMapper)(mapToCode(n)), (c) => unmapFromCode((0, IndexToCharString_1.indexToCharStringUnmapper)(c))); }