All notable changes to Gofakeit JS are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Framework-safe value setting. Generated values are written through the native
HTMLInputElement/HTMLTextAreaElement/HTMLSelectElementsetters, so frameworks that install an own value/checked tracker (for example React'sonChange) observe the change.inputandchangeare still dispatched. - Autocomplete-aware resolution. Standard
autocompletetokens (given-name,family-name,email,tel,street-address,postal-code,cc-number, and more) map to exact generators before any fuzzy search runs. - New
AutofillSettingsfor constraining resolution:typeFunctions,minSearchScore,minSearchScoreMargin,excludedFunctions, andresolveFunction. onFunctionDeterminedcallback plusscore,reasons, andresolvedByon everyAutofillElement, so callers can see which function was chosen and why.dryRunmode: resolve functions and generate values without writing anything to the DOM.- Constraint awareness: generated text respects
maxlength/minlength, and numbers respectmin/max/step. - Transport options (
apiBaseUrl,timeout,retries) onAutofill, andFetchOptions/DEFAULT_API_BASEexported from the API client, with timeout handling and bounded retries for network errors,429, and5xx. AutofillResolvedBytype describing how a function was chosen.
- Search results are mapped back to elements by the id echoed by the API instead of by array position, so responses can be reordered or batched without misassigning functions.
- Element dedupes search queries and no longer sends the raw generic input
type(text,search, ...), which was low-signal noise in the ranking. minSearchScoreMarginnow defaults to1.25. Close calls where the top two candidates score within 25% fall back to the deterministic type function instead of silently picking a possibly wrong generator.
email,tel,url, andpasswordinputs are resolved by their exact generator and are no longer routed through fuzzy search. This fixes the case where<input type="email">with a "body" or "message" label was resolved toemail_textand filled with a fullSubject: ...message.- A structural guard prevents multi-line / message-body generators (
email_text,paragraph) from being chosen for single-line inputs. - Search failures, rejected candidates, and unanswered requests now fall back to the deterministic type function instead of leaving a function unset.
Previous release. See the repository history for details.