tonightpass 0.0.98 → 0.0.100
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/rest/dtos/organizations/create-organization.dto.ts +2 -0
- package/src/rest/endpoints.ts +4 -4
- package/src/rest/request/request.ts +3 -0
- package/src/rest/types/careers/index.ts +1 -1
- package/src/rest/types/notifications/index.ts +1 -1
- package/src/rest/types/users/index.ts +6 -0
- package/src/sdk/users/index.ts +11 -1
- package/src/utils/index.ts +20 -0
package/src/utils/index.ts
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
1
|
export const isBrowser = typeof window !== "undefined";
|
|
2
|
+
|
|
3
|
+
export function buildFileFormData(
|
|
4
|
+
key: string,
|
|
5
|
+
files: File | File[] | FileList,
|
|
6
|
+
): FormData {
|
|
7
|
+
const formData = new FormData();
|
|
8
|
+
|
|
9
|
+
if (files instanceof File) {
|
|
10
|
+
// Single file case
|
|
11
|
+
formData.append(key, files);
|
|
12
|
+
} else if (files instanceof FileList) {
|
|
13
|
+
// FileList case
|
|
14
|
+
Array.from(files).forEach((file) => formData.append(key, file));
|
|
15
|
+
} else {
|
|
16
|
+
// Array of files case
|
|
17
|
+
files.forEach((file) => formData.append(key, file));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return formData;
|
|
21
|
+
}
|