@conform-to/dom 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dom.d.ts CHANGED
@@ -2,7 +2,10 @@
2
2
  * Element that user can interact with,
3
3
  * includes `<input>`, `<select>` and `<textarea>`.
4
4
  */
5
- export type FieldElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
5
+ export type FieldElement =
6
+ | HTMLInputElement
7
+ | HTMLSelectElement
8
+ | HTMLTextAreaElement;
6
9
  /**
7
10
  * HTML Element that can be used as a form control,
8
11
  * includes `<input>`, `<select>`, `<textarea>` and `<button>`.
@@ -20,7 +23,9 @@ export declare function isFormControl(element: unknown): element is FormControl;
20
23
  * A type guard to check if the provided element is a field element, which
21
24
  * is a form control excluding submit, button and reset type.
22
25
  */
23
- export declare function isFieldElement(element: unknown): element is FieldElement;
26
+ export declare function isFieldElement(
27
+ element: unknown,
28
+ ): element is FieldElement;
24
29
  /**
25
30
  * Resolves the action from the submit event
26
31
  * with respect to the submitter `formaction` attribute.
@@ -30,14 +35,21 @@ export declare function getFormAction(event: SubmitEvent): string;
30
35
  * Resolves the encoding type from the submit event
31
36
  * with respect to the submitter `formenctype` attribute.
32
37
  */
33
- export declare function getFormEncType(event: SubmitEvent): 'application/x-www-form-urlencoded' | 'multipart/form-data';
38
+ export declare function getFormEncType(
39
+ event: SubmitEvent,
40
+ ): 'application/x-www-form-urlencoded' | 'multipart/form-data';
34
41
  /**
35
42
  * Resolves the method from the submit event
36
43
  * with respect to the submitter `formmethod` attribute.
37
44
  */
38
- export declare function getFormMethod(event: SubmitEvent): 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
45
+ export declare function getFormMethod(
46
+ event: SubmitEvent,
47
+ ): 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
39
48
  /**
40
49
  * Trigger a form submit event with an optional submitter.
41
50
  * If the submitter is not mounted, it will be appended to the form and removed after submission.
42
51
  */
43
- export declare function requestSubmit(form: HTMLFormElement | null | undefined, submitter: Submitter | null): void;
52
+ export declare function requestSubmit(
53
+ form: HTMLFormElement | null | undefined,
54
+ submitter: Submitter | null,
55
+ ): void;
package/form.d.ts CHANGED
@@ -1,147 +1,246 @@
1
1
  import { getFormAction, getFormEncType, getFormMethod } from './dom';
2
- import { type Intent, type Submission, type SubmissionResult } from './submission';
3
- type BaseCombine<T, K extends PropertyKey = T extends unknown ? keyof T : never> = T extends unknown ? T & Partial<Record<Exclude<K, keyof T>, never>> : never;
2
+ import {
3
+ type Intent,
4
+ type Submission,
5
+ type SubmissionResult,
6
+ } from './submission';
7
+ type BaseCombine<
8
+ T,
9
+ K extends PropertyKey = T extends unknown ? keyof T : never,
10
+ > = T extends unknown ? T & Partial<Record<Exclude<K, keyof T>, never>> : never;
4
11
  export type Combine<T> = {
5
- [K in keyof BaseCombine<T>]: BaseCombine<T>[K];
12
+ [K in keyof BaseCombine<T>]: BaseCombine<T>[K];
6
13
  };
7
- export type DefaultValue<Schema> = Schema extends string | number | boolean | Date | bigint | null | undefined ? Schema | string | null | undefined : Schema extends File ? null | undefined : Schema extends Array<infer Item> ? Array<DefaultValue<Item>> | null | undefined : Schema extends Record<string, any> ? {
8
- [Key in keyof Schema]?: DefaultValue<Schema[Key]>;
9
- } | null | undefined : string | null | undefined;
10
- export type FormValue<Schema> = Schema extends string | number | boolean | Date | bigint | null | undefined ? string | undefined : Schema extends File ? File | undefined : Schema extends File[] ? File | Array<File> | undefined : Schema extends Array<infer Item> ? string | Array<FormValue<Item>> | undefined : Schema extends Record<string, any> ? {
11
- [Key in keyof Schema]?: FormValue<Schema[Key]>;
12
- } | null | undefined : unknown;
14
+ export type DefaultValue<Schema> = Schema extends
15
+ | string
16
+ | number
17
+ | boolean
18
+ | Date
19
+ | bigint
20
+ | null
21
+ | undefined
22
+ ? Schema | string | null | undefined
23
+ : Schema extends File
24
+ ? null | undefined
25
+ : Schema extends Array<infer Item>
26
+ ? Array<DefaultValue<Item>> | null | undefined
27
+ : Schema extends Record<string, any>
28
+ ?
29
+ | {
30
+ [Key in keyof Schema]?: DefaultValue<Schema[Key]>;
31
+ }
32
+ | null
33
+ | undefined
34
+ : string | null | undefined;
35
+ export type FormValue<Schema> = Schema extends
36
+ | string
37
+ | number
38
+ | boolean
39
+ | Date
40
+ | bigint
41
+ | null
42
+ | undefined
43
+ ? string | undefined
44
+ : Schema extends File
45
+ ? File | undefined
46
+ : Schema extends File[]
47
+ ? File | Array<File> | undefined
48
+ : Schema extends Array<infer Item>
49
+ ? string | Array<FormValue<Item>> | undefined
50
+ : Schema extends Record<string, any>
51
+ ?
52
+ | {
53
+ [Key in keyof Schema]?: FormValue<Schema[Key]>;
54
+ }
55
+ | null
56
+ | undefined
57
+ : unknown;
13
58
  declare const error: unique symbol;
14
59
  declare const field: unique symbol;
15
60
  declare const form: unique symbol;
16
- export type FormId<Schema extends Record<string, unknown> = Record<string, unknown>, Error = string[]> = string & {
17
- [error]?: Error;
18
- [form]?: Schema;
61
+ export type FormId<
62
+ Schema extends Record<string, unknown> = Record<string, unknown>,
63
+ Error = string[],
64
+ > = string & {
65
+ [error]?: Error;
66
+ [form]?: Schema;
19
67
  };
20
- export type FieldName<FieldSchema, FormSchema extends Record<string, unknown> = Record<string, unknown>, Error = string[]> = string & {
21
- [field]?: FieldSchema;
22
- [error]?: Error;
23
- [form]?: FormSchema;
68
+ export type FieldName<
69
+ FieldSchema,
70
+ FormSchema extends Record<string, unknown> = Record<string, unknown>,
71
+ Error = string[],
72
+ > = string & {
73
+ [field]?: FieldSchema;
74
+ [error]?: Error;
75
+ [form]?: FormSchema;
24
76
  };
25
77
  export type Constraint = {
26
- required?: boolean;
27
- minLength?: number;
28
- maxLength?: number;
29
- min?: string | number;
30
- max?: string | number;
31
- step?: string | number;
32
- multiple?: boolean;
33
- pattern?: string;
78
+ required?: boolean;
79
+ minLength?: number;
80
+ maxLength?: number;
81
+ min?: string | number;
82
+ max?: string | number;
83
+ step?: string | number;
84
+ multiple?: boolean;
85
+ pattern?: string;
34
86
  };
35
87
  export type FormMeta<FormError> = {
36
- formId: string;
37
- isValueUpdated: boolean;
38
- submissionStatus?: 'error' | 'success';
39
- defaultValue: Record<string, unknown>;
40
- initialValue: Record<string, unknown>;
41
- value: Record<string, unknown>;
42
- error: Record<string, FormError>;
43
- constraint: Record<string, Constraint>;
44
- key: Record<string, string | undefined>;
45
- validated: Record<string, boolean>;
88
+ formId: string;
89
+ isValueUpdated: boolean;
90
+ submissionStatus?: 'error' | 'success';
91
+ defaultValue: Record<string, unknown>;
92
+ initialValue: Record<string, unknown>;
93
+ value: Record<string, unknown>;
94
+ error: Record<string, FormError>;
95
+ constraint: Record<string, Constraint>;
96
+ key: Record<string, string | undefined>;
97
+ validated: Record<string, boolean>;
46
98
  };
47
- export type FormState<FormError> = Omit<FormMeta<FormError>, 'formId' | 'isValueUpdated'> & {
48
- valid: Record<string, boolean>;
49
- dirty: Record<string, boolean>;
99
+ export type FormState<FormError> = Omit<
100
+ FormMeta<FormError>,
101
+ 'formId' | 'isValueUpdated'
102
+ > & {
103
+ valid: Record<string, boolean>;
104
+ dirty: Record<string, boolean>;
50
105
  };
51
106
  export type FormOptions<Schema, FormError = string[], FormValue = Schema> = {
52
- /**
53
- * The id of the form.
54
- */
55
- formId: string;
56
- /**
57
- * An object representing the initial value of the form.
58
- */
59
- defaultValue?: DefaultValue<Schema>;
60
- /**
61
- * An object describing the constraint of each field
62
- */
63
- constraint?: Record<string, Constraint>;
64
- /**
65
- * An object describing the result of the last submission
66
- */
67
- lastResult?: SubmissionResult<FormError> | null | undefined;
68
- /**
69
- * Define when conform should start validation.
70
- * Support "onSubmit", "onInput", "onBlur".
71
- *
72
- * @default "onSubmit"
73
- */
74
- shouldValidate?: 'onSubmit' | 'onBlur' | 'onInput';
75
- /**
76
- * Define when conform should revalidate again.
77
- * Support "onSubmit", "onInput", "onBlur".
78
- *
79
- * @default Same as shouldValidate, or "onSubmit" if shouldValidate is not provided.
80
- */
81
- shouldRevalidate?: 'onSubmit' | 'onBlur' | 'onInput';
82
- /**
83
- * Define if conform should considered the field for dirty state.
84
- * e.g. Excluding form fields that are not managed by Conform, such as CSRF token
85
- */
86
- shouldDirtyConsider?: (name: string) => boolean;
87
- /**
88
- * A function to be called when the form should be (re)validated.
89
- */
90
- onValidate?: (context: {
91
- form: HTMLFormElement;
92
- submitter: HTMLInputElement | HTMLButtonElement | null;
93
- formData: FormData;
94
- }) => Submission<Schema, FormError, FormValue>;
107
+ /**
108
+ * The id of the form.
109
+ */
110
+ formId: string;
111
+ /**
112
+ * An object representing the initial value of the form.
113
+ */
114
+ defaultValue?: DefaultValue<Schema>;
115
+ /**
116
+ * An object describing the constraint of each field
117
+ */
118
+ constraint?: Record<string, Constraint>;
119
+ /**
120
+ * An object describing the result of the last submission
121
+ */
122
+ lastResult?: SubmissionResult<FormError> | null | undefined;
123
+ /**
124
+ * Define when conform should start validation.
125
+ * Support "onSubmit", "onInput", "onBlur".
126
+ *
127
+ * @default "onSubmit"
128
+ */
129
+ shouldValidate?: 'onSubmit' | 'onBlur' | 'onInput';
130
+ /**
131
+ * Define when conform should revalidate again.
132
+ * Support "onSubmit", "onInput", "onBlur".
133
+ *
134
+ * @default Same as shouldValidate, or "onSubmit" if shouldValidate is not provided.
135
+ */
136
+ shouldRevalidate?: 'onSubmit' | 'onBlur' | 'onInput';
137
+ /**
138
+ * Define if conform should considered the field for dirty state.
139
+ * e.g. Excluding form fields that are not managed by Conform, such as CSRF token
140
+ */
141
+ shouldDirtyConsider?: (name: string) => boolean;
142
+ /**
143
+ * A function to be called when the form should be (re)validated.
144
+ */
145
+ onValidate?: (context: {
146
+ form: HTMLFormElement;
147
+ submitter: HTMLInputElement | HTMLButtonElement | null;
148
+ formData: FormData;
149
+ }) => Submission<Schema, FormError, FormValue>;
95
150
  };
96
151
  export type SubscriptionSubject = {
97
- [key in 'error' | 'initialValue' | 'value' | 'key' | 'valid' | 'dirty']?: SubscriptionScope;
152
+ [key in
153
+ | 'error'
154
+ | 'initialValue'
155
+ | 'value'
156
+ | 'key'
157
+ | 'valid'
158
+ | 'dirty']?: SubscriptionScope;
98
159
  } & {
99
- formId?: boolean;
100
- status?: boolean;
160
+ formId?: boolean;
161
+ status?: boolean;
101
162
  };
102
163
  export type SubscriptionScope = {
103
- prefix?: string[];
104
- name?: string[];
164
+ prefix?: string[];
165
+ name?: string[];
105
166
  };
106
167
  export type ControlButtonProps = {
107
- name: string;
108
- value: string;
109
- form: string;
110
- formNoValidate: boolean;
168
+ name: string;
169
+ value: string;
170
+ form: string;
171
+ formNoValidate: boolean;
111
172
  };
112
- export type FormContext<Schema extends Record<string, any> = any, FormError = string[], FormValue = Schema> = {
113
- getFormId(): string;
114
- submit(event: SubmitEvent): {
115
- formData: FormData;
116
- action: ReturnType<typeof getFormAction>;
117
- encType: ReturnType<typeof getFormEncType>;
118
- method: ReturnType<typeof getFormMethod>;
119
- submission?: Submission<Schema, FormError, FormValue>;
120
- };
121
- onReset(event: Event): void;
122
- onInput(event: Event): void;
123
- onBlur(event: Event): void;
124
- onUpdate(options: Partial<FormOptions<Schema, FormError, FormValue>>): void;
125
- observe(): () => void;
126
- subscribe(callback: () => void, getSubject?: () => SubscriptionSubject | undefined): () => void;
127
- getState(): FormState<FormError>;
128
- getSerializedState(): string;
173
+ export type FormContext<
174
+ Schema extends Record<string, any> = any,
175
+ FormError = string[],
176
+ FormValue = Schema,
177
+ > = {
178
+ getFormId(): string;
179
+ submit(event: SubmitEvent): {
180
+ formData: FormData;
181
+ action: ReturnType<typeof getFormAction>;
182
+ encType: ReturnType<typeof getFormEncType>;
183
+ method: ReturnType<typeof getFormMethod>;
184
+ submission?: Submission<Schema, FormError, FormValue>;
185
+ };
186
+ onReset(event: Event): void;
187
+ onInput(event: Event): void;
188
+ onBlur(event: Event): void;
189
+ onUpdate(options: Partial<FormOptions<Schema, FormError, FormValue>>): void;
190
+ observe(): () => void;
191
+ subscribe(
192
+ callback: () => void,
193
+ getSubject?: () => SubscriptionSubject | undefined,
194
+ ): () => void;
195
+ getState(): FormState<FormError>;
196
+ getSerializedState(): string;
129
197
  } & {
130
- [Type in Intent['type']]: {} extends Extract<Intent, {
131
- type: Type;
132
- }>['payload'] ? (<FieldSchema = Schema>(payload?: Extract<Intent<FieldSchema>, {
133
- type: Type;
134
- }>['payload']) => void) & {
135
- getButtonProps<FieldSchema = Schema>(payload?: Extract<Intent<FieldSchema>, {
136
- type: Type;
137
- }>['payload']): ControlButtonProps;
138
- } : (<FieldSchema = Schema>(payload: Extract<Intent<FieldSchema>, {
139
- type: Type;
140
- }>['payload']) => void) & {
141
- getButtonProps<FieldSchema = Schema>(payload: Extract<Intent<FieldSchema>, {
142
- type: Type;
143
- }>['payload']): ControlButtonProps;
144
- };
198
+ [Type in Intent['type']]: {} extends Extract<
199
+ Intent,
200
+ {
201
+ type: Type;
202
+ }
203
+ >['payload']
204
+ ? (<FieldSchema = Schema>(
205
+ payload?: Extract<
206
+ Intent<FieldSchema>,
207
+ {
208
+ type: Type;
209
+ }
210
+ >['payload'],
211
+ ) => void) & {
212
+ getButtonProps<FieldSchema = Schema>(
213
+ payload?: Extract<
214
+ Intent<FieldSchema>,
215
+ {
216
+ type: Type;
217
+ }
218
+ >['payload'],
219
+ ): ControlButtonProps;
220
+ }
221
+ : (<FieldSchema = Schema>(
222
+ payload: Extract<
223
+ Intent<FieldSchema>,
224
+ {
225
+ type: Type;
226
+ }
227
+ >['payload'],
228
+ ) => void) & {
229
+ getButtonProps<FieldSchema = Schema>(
230
+ payload: Extract<
231
+ Intent<FieldSchema>,
232
+ {
233
+ type: Type;
234
+ }
235
+ >['payload'],
236
+ ): ControlButtonProps;
237
+ };
145
238
  };
146
- export declare function createFormContext<Schema extends Record<string, any>, FormError = string[], FormValue = Schema>(options: FormOptions<Schema, FormError, FormValue>): FormContext<Schema, FormError, FormValue>;
239
+ export declare function createFormContext<
240
+ Schema extends Record<string, any>,
241
+ FormError = string[],
242
+ FormValue = Schema,
243
+ >(
244
+ options: FormOptions<Schema, FormError, FormValue>,
245
+ ): FormContext<Schema, FormError, FormValue>;
147
246
  export {};
package/form.js CHANGED
@@ -74,7 +74,7 @@ function handleIntent(meta, intent, fields, initialized) {
74
74
  } = intent.payload;
75
75
  var _name2 = formdata.formatName(intent.payload.name, intent.payload.index);
76
76
  if (typeof value !== 'undefined') {
77
- updateValue(meta, _name2 !== null && _name2 !== void 0 ? _name2 : '', submission.serialize(value));
77
+ updateValue(meta, _name2 !== null && _name2 !== void 0 ? _name2 : '', value);
78
78
  }
79
79
  if (typeof validated !== 'undefined') {
80
80
  // Clean up previous validated state
package/form.mjs CHANGED
@@ -70,7 +70,7 @@ function handleIntent(meta, intent, fields, initialized) {
70
70
  } = intent.payload;
71
71
  var _name2 = formatName(intent.payload.name, intent.payload.index);
72
72
  if (typeof value !== 'undefined') {
73
- updateValue(meta, _name2 !== null && _name2 !== void 0 ? _name2 : '', serialize(value));
73
+ updateValue(meta, _name2 !== null && _name2 !== void 0 ? _name2 : '', value);
74
74
  }
75
75
  if (typeof validated !== 'undefined') {
76
76
  // Clean up previous validated state
package/formdata.d.ts CHANGED
@@ -55,7 +55,7 @@ export declare function normalize(value: unknown, acceptFile?: boolean): unknown
55
55
  /**
56
56
  * Flatten a tree into a dictionary
57
57
  */
58
- export declare function flatten(data: Record<string | number | symbol, unknown> | Array<unknown> | undefined, options?: {
59
- resolve?: (data: unknown) => unknown | null;
58
+ export declare function flatten(data: unknown, options?: {
59
+ resolve?: (data: unknown) => unknown;
60
60
  prefix?: string;
61
61
  }): Record<string, unknown>;
package/formdata.js CHANGED
@@ -174,51 +174,29 @@ function normalize(value) {
174
174
  /**
175
175
  * Flatten a tree into a dictionary
176
176
  */
177
- function flatten(data, options) {
177
+ function flatten(data) {
178
178
  var _options$resolve;
179
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
179
180
  var result = {};
180
- var resolve = (_options$resolve = options === null || options === void 0 ? void 0 : options.resolve) !== null && _options$resolve !== void 0 ? _options$resolve : data => data;
181
- function setResult(data, name) {
181
+ var resolve = (_options$resolve = options.resolve) !== null && _options$resolve !== void 0 ? _options$resolve : data => data;
182
+ function process(data, prefix) {
182
183
  var value = normalize(resolve(data));
183
184
  if (typeof value !== 'undefined') {
184
- result[name] = value;
185
+ result[prefix] = value;
185
186
  }
186
- }
187
- function processObject(obj, prefix) {
188
- setResult(obj, prefix);
189
- for (var [key, _value] of Object.entries(obj)) {
190
- var name = prefix ? "".concat(prefix, ".").concat(key) : key;
191
- if (Array.isArray(_value)) {
192
- processArray(_value, name);
193
- } else if (_value && isPlainObject(_value)) {
194
- processObject(_value, name);
195
- } else {
196
- setResult(_value, name);
187
+ if (Array.isArray(data)) {
188
+ for (var i = 0; i < data.length; i++) {
189
+ process(data[i], "".concat(prefix, "[").concat(i, "]"));
197
190
  }
198
- }
199
- }
200
- function processArray(array, prefix) {
201
- setResult(array, prefix);
202
- for (var i = 0; i < array.length; i++) {
203
- var item = array[i];
204
- var name = "".concat(prefix, "[").concat(i, "]");
205
- if (Array.isArray(item)) {
206
- processArray(item, name);
207
- } else if (item && isPlainObject(item)) {
208
- processObject(item, name);
209
- } else {
210
- setResult(item, name);
191
+ } else if (isPlainObject(data)) {
192
+ for (var [key, _value] of Object.entries(data)) {
193
+ process(_value, prefix ? "".concat(prefix, ".").concat(key) : key);
211
194
  }
212
195
  }
213
196
  }
214
197
  if (data) {
215
198
  var _options$prefix;
216
- var prefix = (_options$prefix = options === null || options === void 0 ? void 0 : options.prefix) !== null && _options$prefix !== void 0 ? _options$prefix : '';
217
- if (Array.isArray(data)) {
218
- processArray(data, prefix);
219
- } else {
220
- processObject(data, prefix);
221
- }
199
+ process(data, (_options$prefix = options.prefix) !== null && _options$prefix !== void 0 ? _options$prefix : '');
222
200
  }
223
201
  return result;
224
202
  }
package/formdata.mjs CHANGED
@@ -170,51 +170,29 @@ function normalize(value) {
170
170
  /**
171
171
  * Flatten a tree into a dictionary
172
172
  */
173
- function flatten(data, options) {
173
+ function flatten(data) {
174
174
  var _options$resolve;
175
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
175
176
  var result = {};
176
- var resolve = (_options$resolve = options === null || options === void 0 ? void 0 : options.resolve) !== null && _options$resolve !== void 0 ? _options$resolve : data => data;
177
- function setResult(data, name) {
177
+ var resolve = (_options$resolve = options.resolve) !== null && _options$resolve !== void 0 ? _options$resolve : data => data;
178
+ function process(data, prefix) {
178
179
  var value = normalize(resolve(data));
179
180
  if (typeof value !== 'undefined') {
180
- result[name] = value;
181
+ result[prefix] = value;
181
182
  }
182
- }
183
- function processObject(obj, prefix) {
184
- setResult(obj, prefix);
185
- for (var [key, _value] of Object.entries(obj)) {
186
- var name = prefix ? "".concat(prefix, ".").concat(key) : key;
187
- if (Array.isArray(_value)) {
188
- processArray(_value, name);
189
- } else if (_value && isPlainObject(_value)) {
190
- processObject(_value, name);
191
- } else {
192
- setResult(_value, name);
183
+ if (Array.isArray(data)) {
184
+ for (var i = 0; i < data.length; i++) {
185
+ process(data[i], "".concat(prefix, "[").concat(i, "]"));
193
186
  }
194
- }
195
- }
196
- function processArray(array, prefix) {
197
- setResult(array, prefix);
198
- for (var i = 0; i < array.length; i++) {
199
- var item = array[i];
200
- var name = "".concat(prefix, "[").concat(i, "]");
201
- if (Array.isArray(item)) {
202
- processArray(item, name);
203
- } else if (item && isPlainObject(item)) {
204
- processObject(item, name);
205
- } else {
206
- setResult(item, name);
187
+ } else if (isPlainObject(data)) {
188
+ for (var [key, _value] of Object.entries(data)) {
189
+ process(_value, prefix ? "".concat(prefix, ".").concat(key) : key);
207
190
  }
208
191
  }
209
192
  }
210
193
  if (data) {
211
194
  var _options$prefix;
212
- var prefix = (_options$prefix = options === null || options === void 0 ? void 0 : options.prefix) !== null && _options$prefix !== void 0 ? _options$prefix : '';
213
- if (Array.isArray(data)) {
214
- processArray(data, prefix);
215
- } else {
216
- processObject(data, prefix);
217
- }
195
+ process(data, (_options$prefix = options.prefix) !== null && _options$prefix !== void 0 ? _options$prefix : '');
218
196
  }
219
197
  return result;
220
198
  }
package/index.d.ts CHANGED
@@ -1,4 +1,26 @@
1
- export { type Combine, type Constraint, type ControlButtonProps, type FormId, type FieldName, type DefaultValue, type FormValue, type FormOptions, type FormState, type FormContext, type SubscriptionSubject, type SubscriptionScope, createFormContext as unstable_createFormContext, } from './form';
1
+ export {
2
+ type Combine,
3
+ type Constraint,
4
+ type ControlButtonProps,
5
+ type FormId,
6
+ type FieldName,
7
+ type DefaultValue,
8
+ type FormValue,
9
+ type FormOptions,
10
+ type FormState,
11
+ type FormContext,
12
+ type SubscriptionSubject,
13
+ type SubscriptionScope,
14
+ createFormContext as unstable_createFormContext,
15
+ } from './form';
2
16
  export { type FieldElement, isFieldElement } from './dom';
3
- export { type Submission, type SubmissionResult, type Intent, INTENT, STATE, serializeIntent, parse, } from './submission';
17
+ export {
18
+ type Submission,
19
+ type SubmissionResult,
20
+ type Intent,
21
+ INTENT,
22
+ STATE,
23
+ serializeIntent,
24
+ parse,
25
+ } from './submission';
4
26
  export { getPaths, formatPaths, isPrefix } from './formdata';