@alextheman/utility 2.13.0 → 2.13.1
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/dist/index.cjs +4 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -127,7 +127,10 @@ function getNullableResolutionStrategy(key, strategy) {
|
|
|
127
127
|
var _a;
|
|
128
128
|
return (_a = typeof strategy === "object" ? strategy[key] : strategy) != null ? _a : "empty";
|
|
129
129
|
}
|
|
130
|
-
function createFormData(data, options = {
|
|
130
|
+
function createFormData(data, options = {
|
|
131
|
+
arrayResolution: "stringify",
|
|
132
|
+
nullableResolution: "empty"
|
|
133
|
+
}) {
|
|
131
134
|
const formData = new FormData();
|
|
132
135
|
function resolveNullablesByStrategy(key, value, resolutionStrategy) {
|
|
133
136
|
switch (resolutionStrategy) {
|
package/dist/index.d.cts
CHANGED
|
@@ -58,7 +58,7 @@ interface CreateFormDataOptionsNullableResolution<K extends RecordKey> extends C
|
|
|
58
58
|
nullableResolution: FormDataNullableResolutionStrategy | Partial<Record<K, FormDataNullableResolutionStrategy>>;
|
|
59
59
|
}
|
|
60
60
|
type CreateFormDataOptions<K extends RecordKey> = CreateFormDataOptionsUndefinedOrNullResolution<K> | CreateFormDataOptionsNullableResolution<K>;
|
|
61
|
-
declare function createFormData<T extends Record<RecordKey, unknown
|
|
61
|
+
declare function createFormData<T extends Record<RecordKey, unknown>>(data: T, options?: CreateFormDataOptions<keyof T>): FormData;
|
|
62
62
|
|
|
63
63
|
declare function fillArray<T>(callback: (index: number) => Promise<T>, length?: number): Promise<T[]>;
|
|
64
64
|
declare function fillArray<T>(callback: (index: number) => T, length?: number): T[];
|
package/dist/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ interface CreateFormDataOptionsNullableResolution<K extends RecordKey> extends C
|
|
|
58
58
|
nullableResolution: FormDataNullableResolutionStrategy | Partial<Record<K, FormDataNullableResolutionStrategy>>;
|
|
59
59
|
}
|
|
60
60
|
type CreateFormDataOptions<K extends RecordKey> = CreateFormDataOptionsUndefinedOrNullResolution<K> | CreateFormDataOptionsNullableResolution<K>;
|
|
61
|
-
declare function createFormData<T extends Record<RecordKey, unknown
|
|
61
|
+
declare function createFormData<T extends Record<RecordKey, unknown>>(data: T, options?: CreateFormDataOptions<keyof T>): FormData;
|
|
62
62
|
|
|
63
63
|
declare function fillArray<T>(callback: (index: number) => Promise<T>, length?: number): Promise<T[]>;
|
|
64
64
|
declare function fillArray<T>(callback: (index: number) => T, length?: number): T[];
|
package/dist/index.js
CHANGED
|
@@ -67,7 +67,10 @@ function getNullableResolutionStrategy(key, strategy) {
|
|
|
67
67
|
var _a;
|
|
68
68
|
return (_a = typeof strategy === "object" ? strategy[key] : strategy) != null ? _a : "empty";
|
|
69
69
|
}
|
|
70
|
-
function createFormData(data, options = {
|
|
70
|
+
function createFormData(data, options = {
|
|
71
|
+
arrayResolution: "stringify",
|
|
72
|
+
nullableResolution: "empty"
|
|
73
|
+
}) {
|
|
71
74
|
const formData = new FormData();
|
|
72
75
|
function resolveNullablesByStrategy(key, value, resolutionStrategy) {
|
|
73
76
|
switch (resolutionStrategy) {
|