fast-check
Advanced tools
Comparing version 3.21.0 to 3.22.0
@@ -0,1 +1,22 @@ | ||
# 3.22.0 | ||
_Graphemes support on `fc.string`_ | ||
[[Code](https://github.com/dubzzz/fast-check/tree/v3.22.0)][[Diff](https://github.com/dubzzz/fast-check/compare/v3.21.0...v3.22.0)] | ||
## Features | ||
- ([PR#5222](https://github.com/dubzzz/fast-check/pull/5222)) Support for grapheme on `fc.string` | ||
- ([PR#5233](https://github.com/dubzzz/fast-check/pull/5233)) Mark as deprecated most of char and string arbitraries | ||
- ([PR#5238](https://github.com/dubzzz/fast-check/pull/5238)) Deprecate `bigInt`'s alternatives | ||
## Fixes | ||
- ([PR#5237](https://github.com/dubzzz/fast-check/pull/5237)) CI: Drop TypeScript rc release channel | ||
- ([PR#5241](https://github.com/dubzzz/fast-check/pull/5241)) CI: Move to changeset | ||
- ([PR#5199](https://github.com/dubzzz/fast-check/pull/5199)) Doc: Publish release note for 3.21.0 | ||
- ([PR#5240](https://github.com/dubzzz/fast-check/pull/5240)) Doc: Better `string`'s deprecation note in documentation | ||
- ([PR#5203](https://github.com/dubzzz/fast-check/pull/5203)) Refactor: Add missing types on exported | ||
--- | ||
# 3.21.0 | ||
@@ -2,0 +23,0 @@ |
@@ -5,13 +5,32 @@ "use strict"; | ||
const array_1 = require("./array"); | ||
const char_1 = require("./char"); | ||
const CodePointsToString_1 = require("./_internals/mappers/CodePointsToString"); | ||
const SlicesForStringBuilder_1 = require("./_internals/helpers/SlicesForStringBuilder"); | ||
const StringUnitArbitrary_1 = require("./_internals/StringUnitArbitrary"); | ||
const PatternsToString_1 = require("./_internals/mappers/PatternsToString"); | ||
const safeObjectAssign = Object.assign; | ||
function extractUnitArbitrary(constraints) { | ||
if (typeof constraints.unit === 'object') { | ||
return constraints.unit; | ||
} | ||
switch (constraints.unit) { | ||
case 'grapheme': | ||
return (0, StringUnitArbitrary_1.stringUnit)('grapheme', 'full'); | ||
case 'grapheme-composite': | ||
return (0, StringUnitArbitrary_1.stringUnit)('composite', 'full'); | ||
case 'grapheme-ascii': | ||
case undefined: | ||
return (0, StringUnitArbitrary_1.stringUnit)('grapheme', 'ascii'); | ||
case 'binary': | ||
return (0, StringUnitArbitrary_1.stringUnit)('binary', 'full'); | ||
case 'binary-ascii': | ||
return (0, StringUnitArbitrary_1.stringUnit)('binary', 'ascii'); | ||
} | ||
} | ||
function string(constraints = {}) { | ||
const charArbitrary = (0, char_1.char)(); | ||
const experimentalCustomSlices = (0, SlicesForStringBuilder_1.createSlicesForString)(charArbitrary, CodePointsToString_1.codePointsToStringUnmapper); | ||
const charArbitrary = extractUnitArbitrary(constraints); | ||
const unmapper = (0, PatternsToString_1.patternsToStringUnmapperFor)(charArbitrary, constraints); | ||
const experimentalCustomSlices = (0, SlicesForStringBuilder_1.createSlicesForString)(charArbitrary, unmapper); | ||
const enrichedConstraints = safeObjectAssign(safeObjectAssign({}, constraints), { | ||
experimentalCustomSlices, | ||
}); | ||
return (0, array_1.array)(charArbitrary, enrichedConstraints).map(CodePointsToString_1.codePointsToStringMapper, CodePointsToString_1.codePointsToStringUnmapper); | ||
return (0, array_1.array)(charArbitrary, enrichedConstraints).map(PatternsToString_1.patternsToStringMapper, unmapper); | ||
} |
import { array } from './array.js'; | ||
import { char } from './char.js'; | ||
import { codePointsToStringMapper, codePointsToStringUnmapper } from './_internals/mappers/CodePointsToString.js'; | ||
import { createSlicesForString } from './_internals/helpers/SlicesForStringBuilder.js'; | ||
import { stringUnit } from './_internals/StringUnitArbitrary.js'; | ||
import { patternsToStringMapper, patternsToStringUnmapperFor } from './_internals/mappers/PatternsToString.js'; | ||
const safeObjectAssign = Object.assign; | ||
function extractUnitArbitrary(constraints) { | ||
if (typeof constraints.unit === 'object') { | ||
return constraints.unit; | ||
} | ||
switch (constraints.unit) { | ||
case 'grapheme': | ||
return stringUnit('grapheme', 'full'); | ||
case 'grapheme-composite': | ||
return stringUnit('composite', 'full'); | ||
case 'grapheme-ascii': | ||
case undefined: | ||
return stringUnit('grapheme', 'ascii'); | ||
case 'binary': | ||
return stringUnit('binary', 'full'); | ||
case 'binary-ascii': | ||
return stringUnit('binary', 'ascii'); | ||
} | ||
} | ||
export function string(constraints = {}) { | ||
const charArbitrary = char(); | ||
const experimentalCustomSlices = createSlicesForString(charArbitrary, codePointsToStringUnmapper); | ||
const charArbitrary = extractUnitArbitrary(constraints); | ||
const unmapper = patternsToStringUnmapperFor(charArbitrary, constraints); | ||
const experimentalCustomSlices = createSlicesForString(charArbitrary, unmapper); | ||
const enrichedConstraints = safeObjectAssign(safeObjectAssign({}, constraints), { | ||
experimentalCustomSlices, | ||
}); | ||
return array(charArbitrary, enrichedConstraints).map(codePointsToStringMapper, codePointsToStringUnmapper); | ||
return array(charArbitrary, enrichedConstraints).map(patternsToStringMapper, unmapper); | ||
} |
@@ -110,4 +110,4 @@ import { pre } from './check/precondition/Pre.js'; | ||
const __type = 'module'; | ||
const __version = '3.21.0'; | ||
const __commitHash = 'bec5d59a5c912e290ca78d8c59ed5eff44355405'; | ||
const __version = '3.22.0'; | ||
const __commitHash = '4e04fda63d913c2b5b1ed604db12341b618b56c5'; | ||
export { __type, __version, __commitHash, sample, statistics, check, assert, pre, PreconditionFailure, property, asyncProperty, boolean, falsy, float, double, integer, nat, maxSafeInteger, maxSafeNat, bigIntN, bigUintN, bigInt, bigUint, char, ascii, char16bits, unicode, fullUnicode, hexa, base64, mixedCase, string, asciiString, string16bits, stringOf, unicodeString, fullUnicodeString, hexaString, base64String, stringMatching, limitShrink, lorem, constant, constantFrom, mapToConstant, option, oneof, clone, noBias, noShrink, shuffledSubarray, subarray, array, sparseArray, infiniteStream, uniqueArray, tuple, record, dictionary, anything, object, json, jsonValue, unicodeJson, unicodeJsonValue, letrec, memo, compareBooleanFunc, compareFunc, func, context, gen, date, ipV4, ipV4Extended, ipV6, domain, webAuthority, webSegment, webFragments, webPath, webQueryParameters, webUrl, emailAddress, ulid, uuid, uuidV, int8Array, uint8Array, uint8ClampedArray, int16Array, uint16Array, int32Array, uint32Array, float32Array, float64Array, bigInt64Array, bigUint64Array, asyncModelRun, modelRun, scheduledModelRun, commands, scheduler, schedulerFor, Arbitrary, Value, cloneMethod, cloneIfNeeded, hasCloneMethod, toStringMethod, hasToStringMethod, asyncToStringMethod, hasAsyncToStringMethod, getDepthContextFor, stringify, asyncStringify, defaultReportMessage, asyncDefaultReportMessage, hash, VerbosityLevel, configureGlobal, readConfigureGlobal, resetConfigureGlobal, ExecutionStatus, Random, Stream, stream, createDepthIdentifier, }; |
@@ -16,3 +16,3 @@ import { filterHelper, flatMapHelper, joinHelper, mapHelper, nilHelper, takeNHelper, takeWhileHelper, } from './StreamHelpers.js'; | ||
} | ||
[safeSymbolIterator]() { | ||
[Symbol.iterator]() { | ||
return this.g; | ||
@@ -19,0 +19,0 @@ } |
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* For single ascii characters - char code between 0x00 (included) and 0x7f (included) | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: 'binary-ascii', minLength: 1, maxLength: 1 })` instead | ||
* @remarks Since 0.0.1 | ||
@@ -5,0 +6,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: 'binary-ascii', ...constraints })` instead | ||
* @remarks Since 0.0.1 | ||
@@ -11,0 +12,0 @@ * @public |
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* For single base64 characters - A-Z, a-z, 0-9, + or / | ||
* @deprecated Prefer using `fc.constantFrom(...'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/')` | ||
* @remarks Since 0.0.1 | ||
@@ -5,0 +6,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: -2n**(n-1n), max: 2n**(n-1n)-1n })` instead | ||
* @remarks Since 1.9.0 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -16,2 +16,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* For positive bigint | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: 0n })` instead | ||
* @remarks Since 1.9.0 | ||
@@ -25,3 +26,3 @@ * @public | ||
* @param max - Upper bound for the generated bigint | ||
* | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: 0n, max })` instead | ||
* @remarks Since 1.9.0 | ||
@@ -36,2 +37,3 @@ * @public | ||
* | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: 0n, max })` instead | ||
* @remarks Since 2.6.0 | ||
@@ -38,0 +40,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: 0n, max: 2n**n-1n })` instead | ||
* @remarks Since 1.9.0 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -7,2 +7,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ minLength: 1, maxLength: 1 })` instead | ||
* @remarks Since 0.0.1 | ||
@@ -9,0 +10,0 @@ * @public |
@@ -10,2 +10,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit, minLength: 1, maxLength: 1 })`, utilizing one of its unit variants instead | ||
* @remarks Since 0.0.11 | ||
@@ -12,0 +13,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 })` or `fc.string({ unit: 'binary', minLength: 1, maxLength: 1 })` instead | ||
* @remarks Since 0.0.11 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: 'grapheme', ...constraints })` or `fc.string({ unit: 'binary', ...constraints })` instead | ||
* @remarks Since 0.0.11 | ||
@@ -11,0 +12,0 @@ * @public |
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* For single hexadecimal characters - 0-9 or a-f | ||
* @deprecated Prefer using `fc.constantFrom(...'0123456789abcdef')` | ||
* @remarks Since 0.0.1 | ||
@@ -5,0 +6,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: fc.constantFrom(...'0123456789abcdef'), ...constraints })` instead | ||
* @remarks Since 0.0.1 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -5,2 +5,29 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* Constraints to be applied on arbitrary {@link string} | ||
* @remarks Since 3.22.0 | ||
* @public | ||
*/ | ||
export type StringConstraints = StringSharedConstraints & { | ||
/** | ||
* A string results from the join between several unitary strings produced by the Arbitrary instance defined by `unit`. | ||
* The `minLength` and `maxLength` refers to the number of these units composing the string. In other words it does not have to be confound with `.length` on an instance of string. | ||
* | ||
* A unit can either be a fully custom Arbitrary or one of the pre-defined options: | ||
* - `'grapheme'` - Any printable grapheme as defined by the Unicode standard. This unit includes graphemes that may: | ||
* - Span multiple code points (e.g., `'\u{0061}\u{0300}'`) | ||
* - Consist of multiple characters (e.g., `'\u{1f431}'`) | ||
* - Include non-European and non-ASCII characters. | ||
* - **Note:** Graphemes produced by this unit are designed to remain visually distinct when joined together. | ||
* - `'grapheme-composite'` - Any printable grapheme limited to a single code point. This option produces graphemes limited to a single code point. | ||
* - **Note:** Graphemes produced by this unit are designed to remain visually distinct when joined together. | ||
* - `'grapheme-ascii'` - Any printable ASCII character. | ||
* - `'binary'` - Any possible code point (except half surrogate pairs), regardless of how it may combine with subsequent code points in the produced string. This unit produces a single code point within the full Unicode range (0000-10FFFF). | ||
* - `'binary-ascii'` - Any possible ASCII character, including control characters. This unit produces any code point in the range 0000-00FF. | ||
* | ||
* @defaultValue 'grapheme-ascii' | ||
* @remarks Since 3.22.0 | ||
*/ | ||
unit?: 'grapheme' | 'grapheme-composite' | 'grapheme-ascii' | 'binary' | 'binary-ascii' | Arbitrary<string>; | ||
}; | ||
/** | ||
* For strings of {@link char} | ||
@@ -13,2 +40,2 @@ * | ||
*/ | ||
export declare function string(constraints?: StringSharedConstraints): Arbitrary<string>; | ||
export declare function string(constraints?: StringConstraints): Arbitrary<string>; |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit, ...constraints })`, utilizing one of its unit variants instead | ||
* @remarks Since 0.0.11 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -10,2 +10,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: charArb, ...constraints })` instead | ||
* @remarks Since 1.1.3 | ||
@@ -12,0 +13,0 @@ * @public |
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* For single unicode characters defined in the BMP plan - char code between 0x0000 (included) and 0xffff (included) and without the range 0xd800 to 0xdfff (surrogate pair characters) | ||
* @deprecated Please use ${@link string} with `fc.string({ unit, minLength: 1, maxLength: 1 })`, utilizing one of its unit variants instead | ||
* @remarks Since 0.0.11 | ||
@@ -5,0 +6,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit, ...constraints })`, utilizing one of its unit variants instead | ||
* @remarks Since 0.0.11 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -93,3 +93,3 @@ import { pre } from './check/precondition/Pre.js'; | ||
import { hexaString } from './arbitrary/hexaString.js'; | ||
import type { StringSharedConstraints } from './arbitrary/string.js'; | ||
import type { StringSharedConstraints, StringConstraints } from './arbitrary/string.js'; | ||
import { string } from './arbitrary/string.js'; | ||
@@ -179,3 +179,3 @@ import { string16bits } from './arbitrary/string16bits.js'; | ||
/** | ||
* Version of fast-check used by your project (eg.: 3.21.0) | ||
* Version of fast-check used by your project (eg.: 3.22.0) | ||
* @remarks Since 1.22.0 | ||
@@ -186,3 +186,3 @@ * @public | ||
/** | ||
* Commit hash of the current code (eg.: bec5d59a5c912e290ca78d8c59ed5eff44355405) | ||
* Commit hash of the current code (eg.: 4e04fda63d913c2b5b1ed604db12341b618b56c5) | ||
* @remarks Since 2.7.0 | ||
@@ -192,3 +192,3 @@ * @public | ||
declare const __commitHash: string; | ||
export type { IRawProperty, IProperty, IPropertyWithHooks, IAsyncProperty, IAsyncPropertyWithHooks, AsyncPropertyHookFunction, PropertyHookFunction, PropertyFailure, AsyncCommand, Command, ICommand, ModelRunSetup, ModelRunAsyncSetup, Scheduler, SchedulerSequenceItem, SchedulerReportItem, SchedulerAct, WithCloneMethod, WithToStringMethod, WithAsyncToStringMethod, DepthContext, ArrayConstraints, BigIntConstraints, BigIntArrayConstraints, BigUintConstraints, CommandsContraints, DateConstraints, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, FalsyContraints, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, UnicodeJsonSharedConstraints, LoremConstraints, MixedCaseConstraints, NatConstraints, ObjectConstraints, OneOfConstraints, OptionConstraints, RecordConstraints, SchedulerConstraints, UniqueArrayConstraints, UniqueArraySharedConstraints, UniqueArrayConstraintsRecommended, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, UuidConstraints, SparseArrayConstraints, StringMatchingConstraints, StringSharedConstraints, SubarrayConstraints, ShuffledSubarrayConstraints, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, MaybeWeightedArbitrary, WeightedArbitrary, LetrecTypedTie, LetrecTypedBuilder, LetrecLooselyTypedTie, LetrecLooselyTypedBuilder, CloneValue, ContextValue, FalsyValue, GeneratorValue, JsonValue, LetrecValue, OneOfValue, RecordValue, Memo, Size, SizeForArbitrary, DepthSize, GlobalParameters, GlobalAsyncPropertyHookFunction, GlobalPropertyHookFunction, Parameters, RandomType, ExecutionTree, RunDetails, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsFailureInterrupted, RunDetailsSuccess, RunDetailsCommon, DepthIdentifier, }; | ||
export type { IRawProperty, IProperty, IPropertyWithHooks, IAsyncProperty, IAsyncPropertyWithHooks, AsyncPropertyHookFunction, PropertyHookFunction, PropertyFailure, AsyncCommand, Command, ICommand, ModelRunSetup, ModelRunAsyncSetup, Scheduler, SchedulerSequenceItem, SchedulerReportItem, SchedulerAct, WithCloneMethod, WithToStringMethod, WithAsyncToStringMethod, DepthContext, ArrayConstraints, BigIntConstraints, BigIntArrayConstraints, BigUintConstraints, CommandsContraints, DateConstraints, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, FalsyContraints, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, UnicodeJsonSharedConstraints, LoremConstraints, MixedCaseConstraints, NatConstraints, ObjectConstraints, OneOfConstraints, OptionConstraints, RecordConstraints, SchedulerConstraints, UniqueArrayConstraints, UniqueArraySharedConstraints, UniqueArrayConstraintsRecommended, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, UuidConstraints, SparseArrayConstraints, StringMatchingConstraints, StringConstraints, StringSharedConstraints, SubarrayConstraints, ShuffledSubarrayConstraints, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, MaybeWeightedArbitrary, WeightedArbitrary, LetrecTypedTie, LetrecTypedBuilder, LetrecLooselyTypedTie, LetrecLooselyTypedBuilder, CloneValue, ContextValue, FalsyValue, GeneratorValue, JsonValue, LetrecValue, OneOfValue, RecordValue, Memo, Size, SizeForArbitrary, DepthSize, GlobalParameters, GlobalAsyncPropertyHookFunction, GlobalPropertyHookFunction, Parameters, RandomType, ExecutionTree, RunDetails, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsFailureInterrupted, RunDetailsSuccess, RunDetailsCommon, DepthIdentifier, }; | ||
export { __type, __version, __commitHash, sample, statistics, check, assert, pre, PreconditionFailure, property, asyncProperty, boolean, falsy, float, double, integer, nat, maxSafeInteger, maxSafeNat, bigIntN, bigUintN, bigInt, bigUint, char, ascii, char16bits, unicode, fullUnicode, hexa, base64, mixedCase, string, asciiString, string16bits, stringOf, unicodeString, fullUnicodeString, hexaString, base64String, stringMatching, limitShrink, lorem, constant, constantFrom, mapToConstant, option, oneof, clone, noBias, noShrink, shuffledSubarray, subarray, array, sparseArray, infiniteStream, uniqueArray, tuple, record, dictionary, anything, object, json, jsonValue, unicodeJson, unicodeJsonValue, letrec, memo, compareBooleanFunc, compareFunc, func, context, gen, date, ipV4, ipV4Extended, ipV6, domain, webAuthority, webSegment, webFragments, webPath, webQueryParameters, webUrl, emailAddress, ulid, uuid, uuidV, int8Array, uint8Array, uint8ClampedArray, int16Array, uint16Array, int32Array, uint32Array, float32Array, float64Array, bigInt64Array, bigUint64Array, asyncModelRun, modelRun, scheduledModelRun, commands, scheduler, schedulerFor, Arbitrary, Value, cloneMethod, cloneIfNeeded, hasCloneMethod, toStringMethod, hasToStringMethod, asyncToStringMethod, hasAsyncToStringMethod, getDepthContextFor, stringify, asyncStringify, defaultReportMessage, asyncDefaultReportMessage, hash, VerbosityLevel, configureGlobal, readConfigureGlobal, resetConfigureGlobal, ExecutionStatus, Random, Stream, stream, createDepthIdentifier, }; |
@@ -1,2 +0,1 @@ | ||
declare const safeSymbolIterator: typeof Symbol.iterator; | ||
/** | ||
@@ -28,3 +27,3 @@ * Wrapper around `IterableIterator` interface | ||
next(): IteratorResult<T>; | ||
[safeSymbolIterator](): IterableIterator<T>; | ||
[Symbol.iterator](): IterableIterator<T>; | ||
/** | ||
@@ -148,2 +147,1 @@ * Map all elements of the Stream using `f` | ||
export declare function stream<T>(g: IterableIterator<T>): Stream<T>; | ||
export {}; |
@@ -241,5 +241,5 @@ "use strict"; | ||
exports.__type = __type; | ||
const __version = '3.21.0'; | ||
const __version = '3.22.0'; | ||
exports.__version = __version; | ||
const __commitHash = 'bec5d59a5c912e290ca78d8c59ed5eff44355405'; | ||
const __commitHash = '4e04fda63d913c2b5b1ed604db12341b618b56c5'; | ||
exports.__commitHash = __commitHash; |
@@ -20,3 +20,3 @@ "use strict"; | ||
} | ||
[safeSymbolIterator]() { | ||
[Symbol.iterator]() { | ||
return this.g; | ||
@@ -23,0 +23,0 @@ } |
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* For single ascii characters - char code between 0x00 (included) and 0x7f (included) | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: 'binary-ascii', minLength: 1, maxLength: 1 })` instead | ||
* @remarks Since 0.0.1 | ||
@@ -5,0 +6,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: 'binary-ascii', ...constraints })` instead | ||
* @remarks Since 0.0.1 | ||
@@ -11,0 +12,0 @@ * @public |
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* For single base64 characters - A-Z, a-z, 0-9, + or / | ||
* @deprecated Prefer using `fc.constantFrom(...'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/')` | ||
* @remarks Since 0.0.1 | ||
@@ -5,0 +6,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: -2n**(n-1n), max: 2n**(n-1n)-1n })` instead | ||
* @remarks Since 1.9.0 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -16,2 +16,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* For positive bigint | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: 0n })` instead | ||
* @remarks Since 1.9.0 | ||
@@ -25,3 +26,3 @@ * @public | ||
* @param max - Upper bound for the generated bigint | ||
* | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: 0n, max })` instead | ||
* @remarks Since 1.9.0 | ||
@@ -36,2 +37,3 @@ * @public | ||
* | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: 0n, max })` instead | ||
* @remarks Since 2.6.0 | ||
@@ -38,0 +40,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link bigInt} with `fc.bigInt({ min: 0n, max: 2n**n-1n })` instead | ||
* @remarks Since 1.9.0 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -7,2 +7,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ minLength: 1, maxLength: 1 })` instead | ||
* @remarks Since 0.0.1 | ||
@@ -9,0 +10,0 @@ * @public |
@@ -10,2 +10,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit, minLength: 1, maxLength: 1 })`, utilizing one of its unit variants instead | ||
* @remarks Since 0.0.11 | ||
@@ -12,0 +13,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: 'grapheme', minLength: 1, maxLength: 1 })` or `fc.string({ unit: 'binary', minLength: 1, maxLength: 1 })` instead | ||
* @remarks Since 0.0.11 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: 'grapheme', ...constraints })` or `fc.string({ unit: 'binary', ...constraints })` instead | ||
* @remarks Since 0.0.11 | ||
@@ -11,0 +12,0 @@ * @public |
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* For single hexadecimal characters - 0-9 or a-f | ||
* @deprecated Prefer using `fc.constantFrom(...'0123456789abcdef')` | ||
* @remarks Since 0.0.1 | ||
@@ -5,0 +6,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: fc.constantFrom(...'0123456789abcdef'), ...constraints })` instead | ||
* @remarks Since 0.0.1 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -5,2 +5,29 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* Constraints to be applied on arbitrary {@link string} | ||
* @remarks Since 3.22.0 | ||
* @public | ||
*/ | ||
export type StringConstraints = StringSharedConstraints & { | ||
/** | ||
* A string results from the join between several unitary strings produced by the Arbitrary instance defined by `unit`. | ||
* The `minLength` and `maxLength` refers to the number of these units composing the string. In other words it does not have to be confound with `.length` on an instance of string. | ||
* | ||
* A unit can either be a fully custom Arbitrary or one of the pre-defined options: | ||
* - `'grapheme'` - Any printable grapheme as defined by the Unicode standard. This unit includes graphemes that may: | ||
* - Span multiple code points (e.g., `'\u{0061}\u{0300}'`) | ||
* - Consist of multiple characters (e.g., `'\u{1f431}'`) | ||
* - Include non-European and non-ASCII characters. | ||
* - **Note:** Graphemes produced by this unit are designed to remain visually distinct when joined together. | ||
* - `'grapheme-composite'` - Any printable grapheme limited to a single code point. This option produces graphemes limited to a single code point. | ||
* - **Note:** Graphemes produced by this unit are designed to remain visually distinct when joined together. | ||
* - `'grapheme-ascii'` - Any printable ASCII character. | ||
* - `'binary'` - Any possible code point (except half surrogate pairs), regardless of how it may combine with subsequent code points in the produced string. This unit produces a single code point within the full Unicode range (0000-10FFFF). | ||
* - `'binary-ascii'` - Any possible ASCII character, including control characters. This unit produces any code point in the range 0000-00FF. | ||
* | ||
* @defaultValue 'grapheme-ascii' | ||
* @remarks Since 3.22.0 | ||
*/ | ||
unit?: 'grapheme' | 'grapheme-composite' | 'grapheme-ascii' | 'binary' | 'binary-ascii' | Arbitrary<string>; | ||
}; | ||
/** | ||
* For strings of {@link char} | ||
@@ -13,2 +40,2 @@ * | ||
*/ | ||
export declare function string(constraints?: StringSharedConstraints): Arbitrary<string>; | ||
export declare function string(constraints?: StringConstraints): Arbitrary<string>; |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit, ...constraints })`, utilizing one of its unit variants instead | ||
* @remarks Since 0.0.11 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -10,2 +10,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit: charArb, ...constraints })` instead | ||
* @remarks Since 1.1.3 | ||
@@ -12,0 +13,0 @@ * @public |
import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
/** | ||
* For single unicode characters defined in the BMP plan - char code between 0x0000 (included) and 0xffff (included) and without the range 0xd800 to 0xdfff (surrogate pair characters) | ||
* @deprecated Please use ${@link string} with `fc.string({ unit, minLength: 1, maxLength: 1 })`, utilizing one of its unit variants instead | ||
* @remarks Since 0.0.11 | ||
@@ -5,0 +6,0 @@ * @public |
@@ -9,2 +9,3 @@ import type { Arbitrary } from '../check/arbitrary/definition/Arbitrary.js'; | ||
* | ||
* @deprecated Please use ${@link string} with `fc.string({ unit, ...constraints })`, utilizing one of its unit variants instead | ||
* @remarks Since 0.0.11 | ||
@@ -11,0 +12,0 @@ * @public |
@@ -93,3 +93,3 @@ import { pre } from './check/precondition/Pre.js'; | ||
import { hexaString } from './arbitrary/hexaString.js'; | ||
import type { StringSharedConstraints } from './arbitrary/string.js'; | ||
import type { StringSharedConstraints, StringConstraints } from './arbitrary/string.js'; | ||
import { string } from './arbitrary/string.js'; | ||
@@ -179,3 +179,3 @@ import { string16bits } from './arbitrary/string16bits.js'; | ||
/** | ||
* Version of fast-check used by your project (eg.: 3.21.0) | ||
* Version of fast-check used by your project (eg.: 3.22.0) | ||
* @remarks Since 1.22.0 | ||
@@ -186,3 +186,3 @@ * @public | ||
/** | ||
* Commit hash of the current code (eg.: bec5d59a5c912e290ca78d8c59ed5eff44355405) | ||
* Commit hash of the current code (eg.: 4e04fda63d913c2b5b1ed604db12341b618b56c5) | ||
* @remarks Since 2.7.0 | ||
@@ -192,3 +192,3 @@ * @public | ||
declare const __commitHash: string; | ||
export type { IRawProperty, IProperty, IPropertyWithHooks, IAsyncProperty, IAsyncPropertyWithHooks, AsyncPropertyHookFunction, PropertyHookFunction, PropertyFailure, AsyncCommand, Command, ICommand, ModelRunSetup, ModelRunAsyncSetup, Scheduler, SchedulerSequenceItem, SchedulerReportItem, SchedulerAct, WithCloneMethod, WithToStringMethod, WithAsyncToStringMethod, DepthContext, ArrayConstraints, BigIntConstraints, BigIntArrayConstraints, BigUintConstraints, CommandsContraints, DateConstraints, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, FalsyContraints, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, UnicodeJsonSharedConstraints, LoremConstraints, MixedCaseConstraints, NatConstraints, ObjectConstraints, OneOfConstraints, OptionConstraints, RecordConstraints, SchedulerConstraints, UniqueArrayConstraints, UniqueArraySharedConstraints, UniqueArrayConstraintsRecommended, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, UuidConstraints, SparseArrayConstraints, StringMatchingConstraints, StringSharedConstraints, SubarrayConstraints, ShuffledSubarrayConstraints, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, MaybeWeightedArbitrary, WeightedArbitrary, LetrecTypedTie, LetrecTypedBuilder, LetrecLooselyTypedTie, LetrecLooselyTypedBuilder, CloneValue, ContextValue, FalsyValue, GeneratorValue, JsonValue, LetrecValue, OneOfValue, RecordValue, Memo, Size, SizeForArbitrary, DepthSize, GlobalParameters, GlobalAsyncPropertyHookFunction, GlobalPropertyHookFunction, Parameters, RandomType, ExecutionTree, RunDetails, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsFailureInterrupted, RunDetailsSuccess, RunDetailsCommon, DepthIdentifier, }; | ||
export type { IRawProperty, IProperty, IPropertyWithHooks, IAsyncProperty, IAsyncPropertyWithHooks, AsyncPropertyHookFunction, PropertyHookFunction, PropertyFailure, AsyncCommand, Command, ICommand, ModelRunSetup, ModelRunAsyncSetup, Scheduler, SchedulerSequenceItem, SchedulerReportItem, SchedulerAct, WithCloneMethod, WithToStringMethod, WithAsyncToStringMethod, DepthContext, ArrayConstraints, BigIntConstraints, BigIntArrayConstraints, BigUintConstraints, CommandsContraints, DateConstraints, DictionaryConstraints, DomainConstraints, DoubleConstraints, EmailAddressConstraints, FalsyContraints, Float32ArrayConstraints, Float64ArrayConstraints, FloatConstraints, IntArrayConstraints, IntegerConstraints, JsonSharedConstraints, UnicodeJsonSharedConstraints, LoremConstraints, MixedCaseConstraints, NatConstraints, ObjectConstraints, OneOfConstraints, OptionConstraints, RecordConstraints, SchedulerConstraints, UniqueArrayConstraints, UniqueArraySharedConstraints, UniqueArrayConstraintsRecommended, UniqueArrayConstraintsCustomCompare, UniqueArrayConstraintsCustomCompareSelect, UuidConstraints, SparseArrayConstraints, StringMatchingConstraints, StringConstraints, StringSharedConstraints, SubarrayConstraints, ShuffledSubarrayConstraints, WebAuthorityConstraints, WebFragmentsConstraints, WebPathConstraints, WebQueryParametersConstraints, WebSegmentConstraints, WebUrlConstraints, MaybeWeightedArbitrary, WeightedArbitrary, LetrecTypedTie, LetrecTypedBuilder, LetrecLooselyTypedTie, LetrecLooselyTypedBuilder, CloneValue, ContextValue, FalsyValue, GeneratorValue, JsonValue, LetrecValue, OneOfValue, RecordValue, Memo, Size, SizeForArbitrary, DepthSize, GlobalParameters, GlobalAsyncPropertyHookFunction, GlobalPropertyHookFunction, Parameters, RandomType, ExecutionTree, RunDetails, RunDetailsFailureProperty, RunDetailsFailureTooManySkips, RunDetailsFailureInterrupted, RunDetailsSuccess, RunDetailsCommon, DepthIdentifier, }; | ||
export { __type, __version, __commitHash, sample, statistics, check, assert, pre, PreconditionFailure, property, asyncProperty, boolean, falsy, float, double, integer, nat, maxSafeInteger, maxSafeNat, bigIntN, bigUintN, bigInt, bigUint, char, ascii, char16bits, unicode, fullUnicode, hexa, base64, mixedCase, string, asciiString, string16bits, stringOf, unicodeString, fullUnicodeString, hexaString, base64String, stringMatching, limitShrink, lorem, constant, constantFrom, mapToConstant, option, oneof, clone, noBias, noShrink, shuffledSubarray, subarray, array, sparseArray, infiniteStream, uniqueArray, tuple, record, dictionary, anything, object, json, jsonValue, unicodeJson, unicodeJsonValue, letrec, memo, compareBooleanFunc, compareFunc, func, context, gen, date, ipV4, ipV4Extended, ipV6, domain, webAuthority, webSegment, webFragments, webPath, webQueryParameters, webUrl, emailAddress, ulid, uuid, uuidV, int8Array, uint8Array, uint8ClampedArray, int16Array, uint16Array, int32Array, uint32Array, float32Array, float64Array, bigInt64Array, bigUint64Array, asyncModelRun, modelRun, scheduledModelRun, commands, scheduler, schedulerFor, Arbitrary, Value, cloneMethod, cloneIfNeeded, hasCloneMethod, toStringMethod, hasToStringMethod, asyncToStringMethod, hasAsyncToStringMethod, getDepthContextFor, stringify, asyncStringify, defaultReportMessage, asyncDefaultReportMessage, hash, VerbosityLevel, configureGlobal, readConfigureGlobal, resetConfigureGlobal, ExecutionStatus, Random, Stream, stream, createDepthIdentifier, }; |
@@ -1,2 +0,1 @@ | ||
declare const safeSymbolIterator: typeof Symbol.iterator; | ||
/** | ||
@@ -28,3 +27,3 @@ * Wrapper around `IterableIterator` interface | ||
next(): IteratorResult<T>; | ||
[safeSymbolIterator](): IterableIterator<T>; | ||
[Symbol.iterator](): IterableIterator<T>; | ||
/** | ||
@@ -148,2 +147,1 @@ * Map all elements of the Stream using `f` | ||
export declare function stream<T>(g: IterableIterator<T>): Stream<T>; | ||
export {}; |
{ | ||
"name": "fast-check", | ||
"version": "3.21.0", | ||
"version": "3.22.0", | ||
"description": "Property based testing framework for JavaScript (like QuickCheck)", | ||
@@ -63,5 +63,5 @@ "type": "commonjs", | ||
"@fast-check/expect-type": "0.2.0", | ||
"@fast-check/poisoning": "0.2.0", | ||
"@microsoft/api-extractor": "^7.47.5", | ||
"@types/node": "^20.14.14", | ||
"@fast-check/poisoning": "0.2.1", | ||
"@microsoft/api-extractor": "^7.47.7", | ||
"@types/node": "^20.14.15", | ||
"@vitest/coverage-v8": "^2.0.5", | ||
@@ -73,3 +73,3 @@ "cross-env": "^7.0.3", | ||
"replace-in-file": "^8.1.0", | ||
"typedoc": "^0.26.5", | ||
"typedoc": "^0.26.6", | ||
"typescript": "~5.5.4", | ||
@@ -76,0 +76,0 @@ "vitest": "^2.0.5" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1298797
942
30511