@jsarc/fodat 0.0.0 → 0.0.1-beta.0.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/README.md +1 -1
- package/fodat.ts +169 -0
- package/index.ts +2 -2
- package/package.json +1 -1
- package/ts/fodat.ts +169 -0
- package/ts/index.ts +175 -0
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ const { Fodat } = require('@jsarc/fodat');
|
|
|
56
56
|
```html
|
|
57
57
|
<script src="@jsarc/fodat/fodat.all.js"></script>
|
|
58
58
|
<script>
|
|
59
|
-
// Disponible globalement comme window.Fodat
|
|
59
|
+
// Disponible globalement comme (window as any).Fodat
|
|
60
60
|
const formData = new FormData();
|
|
61
61
|
formData.append('user.name', 'John');
|
|
62
62
|
const json = Fodat.transform(formData);
|
package/fodat.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
interface Window {
|
|
4
|
+
default: typeof defaultElementGF;
|
|
5
|
+
Fodat: any;
|
|
6
|
+
__bundledModules: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const globalFunct = (function(global: any) {
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Fodat {
|
|
16
|
+
static transform(formData: any): any {
|
|
17
|
+
if(formData instanceof FormData) {
|
|
18
|
+
const result: any = {};
|
|
19
|
+
|
|
20
|
+
for (const [key, value] of formData.entries()) {
|
|
21
|
+
const path = this.parseKeyPath(key);
|
|
22
|
+
this.setDeepValue(result, path, this.wrapValue(value));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return result;
|
|
26
|
+
} else if(
|
|
27
|
+
typeof formData === 'object' &&
|
|
28
|
+
!Array.isArray(formData)
|
|
29
|
+
) {
|
|
30
|
+
return formData;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static toFormData(json: any, form: FormData = new FormData(), parentKey?: string): FormData {
|
|
36
|
+
if (json === null || json === undefined) return form;
|
|
37
|
+
|
|
38
|
+
if (json?.__file === true && json.file instanceof File) {
|
|
39
|
+
form.append(parentKey!, json.file);
|
|
40
|
+
return form;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (typeof json !== "object" || json instanceof File) {
|
|
44
|
+
if (parentKey) form.append(parentKey, json);
|
|
45
|
+
return form;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (Array.isArray(json)) {
|
|
49
|
+
json.forEach((item, index) => {
|
|
50
|
+
const key = parentKey ? `${parentKey}[${index}]` : `${index}`;
|
|
51
|
+
this.toFormData(item, form, key);
|
|
52
|
+
});
|
|
53
|
+
return form;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Object.keys(json).forEach((key) => {
|
|
57
|
+
const newKey = parentKey ? `${parentKey}.${key}` : key;
|
|
58
|
+
this.toFormData(json[key], form, newKey);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return form;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private static wrapValue(value: FormDataEntryValue) {
|
|
65
|
+
if (value instanceof File) {
|
|
66
|
+
|
|
67
|
+
return value;
|
|
68
|
+
} else {
|
|
69
|
+
|
|
70
|
+
const strValue = value.toString();
|
|
71
|
+
|
|
72
|
+
if (strValue === "true") return true;
|
|
73
|
+
if (strValue === "false") return false;
|
|
74
|
+
if (!isNaN(Number(strValue))) return Number(strValue);
|
|
75
|
+
|
|
76
|
+
return strValue;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private static setDeepValue(obj: any, path: (string | number)[], value: any) {
|
|
81
|
+
let current = obj;
|
|
82
|
+
|
|
83
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
84
|
+
const key = path[i];
|
|
85
|
+
const nextKey = path[i + 1];
|
|
86
|
+
|
|
87
|
+
if (current[key] === undefined) {
|
|
88
|
+
current[key] = typeof nextKey === "number" ? [] : {};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
current = current[key];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const finalKey = path[path.length - 1];
|
|
95
|
+
current[finalKey] = value;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private static parseKeyPath(key: string): (string | number)[] {
|
|
99
|
+
const path: (string | number)[] = [];
|
|
100
|
+
const parts = key.split(/\.|(\[\d+\])/).filter(Boolean);
|
|
101
|
+
|
|
102
|
+
for (const p of parts) {
|
|
103
|
+
const match = p.match(/\[(\d+)\]/);
|
|
104
|
+
if (match) {
|
|
105
|
+
path.push(Number(match[1]));
|
|
106
|
+
} else {
|
|
107
|
+
path.push(p);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return path;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
static exposeToGlobal(): void {
|
|
115
|
+
if (typeof window !== "undefined") {
|
|
116
|
+
(window as any).Fodat = Fodat;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (typeof window !== "undefined") {
|
|
122
|
+
(window as any).Fodat = Fodat;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
const globalFunctModule = {
|
|
129
|
+
default: Fodat,
|
|
130
|
+
Fodat: Fodat,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
const __bundledModules = globalFunctModule;
|
|
135
|
+
|
|
136
|
+
if (typeof global !== 'undefined') {
|
|
137
|
+
(global as any).default = Fodat;
|
|
138
|
+
(global as any).Fodat = Fodat;
|
|
139
|
+
(global as any).__bundledModules = __bundledModules;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (typeof window !== "undefined") {
|
|
143
|
+
(window as any).default = Fodat;
|
|
144
|
+
(window as any).Fodat = Fodat;
|
|
145
|
+
(window as any).__bundledModules = __bundledModules;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (typeof exports !== 'undefined') {
|
|
149
|
+
exports.default = Fodat;
|
|
150
|
+
exports.Fodat = Fodat;
|
|
151
|
+
}
|
|
152
|
+
return globalFunctModule;
|
|
153
|
+
|
|
154
|
+
})(typeof global !== 'undefined' ? global :
|
|
155
|
+
typeof window !== 'undefined' ? window :
|
|
156
|
+
typeof self !== 'undefined' ? self :
|
|
157
|
+
typeof globalThis !== 'undefined' ? globalThis :
|
|
158
|
+
{});
|
|
159
|
+
|
|
160
|
+
type FodatElementTypeGF = typeof globalFunct.Fodat;
|
|
161
|
+
|
|
162
|
+
type DefaultElementTypeGF = typeof globalFunct.default;
|
|
163
|
+
|
|
164
|
+
const FodatElementGF: FodatElementTypeGF = globalFunct.Fodat;
|
|
165
|
+
|
|
166
|
+
const defaultElementGF: DefaultElementTypeGF = globalFunct.default;
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
package/index.ts
CHANGED
|
@@ -113,13 +113,13 @@ const globalFunct = (function(global: any) {
|
|
|
113
113
|
|
|
114
114
|
static exposeToGlobal(): void {
|
|
115
115
|
if (typeof window !== "undefined") {
|
|
116
|
-
window.Fodat = Fodat;
|
|
116
|
+
(window as any).Fodat = Fodat;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
if (typeof window !== "undefined") {
|
|
122
|
-
window.Fodat = Fodat;
|
|
122
|
+
(window as any).Fodat = Fodat;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0.0",
|
|
6
|
+
"version": "0.0.1-beta.0.1",
|
|
7
7
|
"description": "Fodat est une bibliothèque JavaScript/TypeScript légère et puissante pour la transformation bidirectionnelle entre FormData et objets JSON. Conçue pour simplifier la manipulation des données de formulaires complexes avec support natif des fichiers et structures imbriquées",
|
|
8
8
|
"main": "index.ts",
|
|
9
9
|
"keywords": [],
|
package/ts/fodat.ts
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
interface Window {
|
|
4
|
+
default: typeof defaultElementGF;
|
|
5
|
+
Fodat: any;
|
|
6
|
+
__bundledModules: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const globalFunct = (function(global: any) {
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Fodat {
|
|
16
|
+
static transform(formData: any): any {
|
|
17
|
+
if(formData instanceof FormData) {
|
|
18
|
+
const result: any = {};
|
|
19
|
+
|
|
20
|
+
for (const [key, value] of formData.entries()) {
|
|
21
|
+
const path = this.parseKeyPath(key);
|
|
22
|
+
this.setDeepValue(result, path, this.wrapValue(value));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return result;
|
|
26
|
+
} else if(
|
|
27
|
+
typeof formData === 'object' &&
|
|
28
|
+
!Array.isArray(formData)
|
|
29
|
+
) {
|
|
30
|
+
return formData;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static toFormData(json: any, form: FormData = new FormData(), parentKey?: string): FormData {
|
|
36
|
+
if (json === null || json === undefined) return form;
|
|
37
|
+
|
|
38
|
+
if (json?.__file === true && json.file instanceof File) {
|
|
39
|
+
form.append(parentKey!, json.file);
|
|
40
|
+
return form;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (typeof json !== "object" || json instanceof File) {
|
|
44
|
+
if (parentKey) form.append(parentKey, json);
|
|
45
|
+
return form;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (Array.isArray(json)) {
|
|
49
|
+
json.forEach((item, index) => {
|
|
50
|
+
const key = parentKey ? `${parentKey}[${index}]` : `${index}`;
|
|
51
|
+
this.toFormData(item, form, key);
|
|
52
|
+
});
|
|
53
|
+
return form;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Object.keys(json).forEach((key) => {
|
|
57
|
+
const newKey = parentKey ? `${parentKey}.${key}` : key;
|
|
58
|
+
this.toFormData(json[key], form, newKey);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return form;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private static wrapValue(value: FormDataEntryValue) {
|
|
65
|
+
if (value instanceof File) {
|
|
66
|
+
|
|
67
|
+
return value;
|
|
68
|
+
} else {
|
|
69
|
+
|
|
70
|
+
const strValue = value.toString();
|
|
71
|
+
|
|
72
|
+
if (strValue === "true") return true;
|
|
73
|
+
if (strValue === "false") return false;
|
|
74
|
+
if (!isNaN(Number(strValue))) return Number(strValue);
|
|
75
|
+
|
|
76
|
+
return strValue;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private static setDeepValue(obj: any, path: (string | number)[], value: any) {
|
|
81
|
+
let current = obj;
|
|
82
|
+
|
|
83
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
84
|
+
const key = path[i];
|
|
85
|
+
const nextKey = path[i + 1];
|
|
86
|
+
|
|
87
|
+
if (current[key] === undefined) {
|
|
88
|
+
current[key] = typeof nextKey === "number" ? [] : {};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
current = current[key];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const finalKey = path[path.length - 1];
|
|
95
|
+
current[finalKey] = value;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private static parseKeyPath(key: string): (string | number)[] {
|
|
99
|
+
const path: (string | number)[] = [];
|
|
100
|
+
const parts = key.split(/\.|(\[\d+\])/).filter(Boolean);
|
|
101
|
+
|
|
102
|
+
for (const p of parts) {
|
|
103
|
+
const match = p.match(/\[(\d+)\]/);
|
|
104
|
+
if (match) {
|
|
105
|
+
path.push(Number(match[1]));
|
|
106
|
+
} else {
|
|
107
|
+
path.push(p);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return path;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
static exposeToGlobal(): void {
|
|
115
|
+
if (typeof window !== "undefined") {
|
|
116
|
+
(window as any).Fodat = Fodat;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (typeof window !== "undefined") {
|
|
122
|
+
(window as any).Fodat = Fodat;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
const globalFunctModule = {
|
|
129
|
+
default: Fodat,
|
|
130
|
+
Fodat: Fodat,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
const __bundledModules = globalFunctModule;
|
|
135
|
+
|
|
136
|
+
if (typeof global !== 'undefined') {
|
|
137
|
+
(global as any).default = Fodat;
|
|
138
|
+
(global as any).Fodat = Fodat;
|
|
139
|
+
(global as any).__bundledModules = __bundledModules;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (typeof window !== "undefined") {
|
|
143
|
+
(window as any).default = Fodat;
|
|
144
|
+
(window as any).Fodat = Fodat;
|
|
145
|
+
(window as any).__bundledModules = __bundledModules;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (typeof exports !== 'undefined') {
|
|
149
|
+
exports.default = Fodat;
|
|
150
|
+
exports.Fodat = Fodat;
|
|
151
|
+
}
|
|
152
|
+
return globalFunctModule;
|
|
153
|
+
|
|
154
|
+
})(typeof global !== 'undefined' ? global :
|
|
155
|
+
typeof window !== 'undefined' ? window :
|
|
156
|
+
typeof self !== 'undefined' ? self :
|
|
157
|
+
typeof globalThis !== 'undefined' ? globalThis :
|
|
158
|
+
{});
|
|
159
|
+
|
|
160
|
+
type FodatElementTypeGF = typeof globalFunct.Fodat;
|
|
161
|
+
|
|
162
|
+
type DefaultElementTypeGF = typeof globalFunct.default;
|
|
163
|
+
|
|
164
|
+
const FodatElementGF: FodatElementTypeGF = globalFunct.Fodat;
|
|
165
|
+
|
|
166
|
+
const defaultElementGF: DefaultElementTypeGF = globalFunct.default;
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
package/ts/index.ts
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
interface Window {
|
|
4
|
+
default: typeof defaultElementGF;
|
|
5
|
+
Fodat: any;
|
|
6
|
+
__bundledModules: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const globalFunct = (function(global: any) {
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Fodat {
|
|
16
|
+
static transform(formData: any): any {
|
|
17
|
+
if(formData instanceof FormData) {
|
|
18
|
+
const result: any = {};
|
|
19
|
+
|
|
20
|
+
for (const [key, value] of formData.entries()) {
|
|
21
|
+
const path = this.parseKeyPath(key);
|
|
22
|
+
this.setDeepValue(result, path, this.wrapValue(value));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return result;
|
|
26
|
+
} else if(
|
|
27
|
+
typeof formData === 'object' &&
|
|
28
|
+
!Array.isArray(formData)
|
|
29
|
+
) {
|
|
30
|
+
return formData;
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static toFormData(json: any, form: FormData = new FormData(), parentKey?: string): FormData {
|
|
36
|
+
if (json === null || json === undefined) return form;
|
|
37
|
+
|
|
38
|
+
if (json?.__file === true && json.file instanceof File) {
|
|
39
|
+
form.append(parentKey!, json.file);
|
|
40
|
+
return form;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (typeof json !== "object" || json instanceof File) {
|
|
44
|
+
if (parentKey) form.append(parentKey, json);
|
|
45
|
+
return form;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (Array.isArray(json)) {
|
|
49
|
+
json.forEach((item, index) => {
|
|
50
|
+
const key = parentKey ? `${parentKey}[${index}]` : `${index}`;
|
|
51
|
+
this.toFormData(item, form, key);
|
|
52
|
+
});
|
|
53
|
+
return form;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Object.keys(json).forEach((key) => {
|
|
57
|
+
const newKey = parentKey ? `${parentKey}.${key}` : key;
|
|
58
|
+
this.toFormData(json[key], form, newKey);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return form;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private static wrapValue(value: FormDataEntryValue) {
|
|
65
|
+
if (value instanceof File) {
|
|
66
|
+
|
|
67
|
+
return value;
|
|
68
|
+
} else {
|
|
69
|
+
|
|
70
|
+
const strValue = value.toString();
|
|
71
|
+
|
|
72
|
+
if (strValue === "true") return true;
|
|
73
|
+
if (strValue === "false") return false;
|
|
74
|
+
if (!isNaN(Number(strValue))) return Number(strValue);
|
|
75
|
+
|
|
76
|
+
return strValue;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private static setDeepValue(obj: any, path: (string | number)[], value: any) {
|
|
81
|
+
let current = obj;
|
|
82
|
+
|
|
83
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
84
|
+
const key = path[i];
|
|
85
|
+
const nextKey = path[i + 1];
|
|
86
|
+
|
|
87
|
+
if (current[key] === undefined) {
|
|
88
|
+
current[key] = typeof nextKey === "number" ? [] : {};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
current = current[key];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const finalKey = path[path.length - 1];
|
|
95
|
+
current[finalKey] = value;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private static parseKeyPath(key: string): (string | number)[] {
|
|
99
|
+
const path: (string | number)[] = [];
|
|
100
|
+
const parts = key.split(/\.|(\[\d+\])/).filter(Boolean);
|
|
101
|
+
|
|
102
|
+
for (const p of parts) {
|
|
103
|
+
const match = p.match(/\[(\d+)\]/);
|
|
104
|
+
if (match) {
|
|
105
|
+
path.push(Number(match[1]));
|
|
106
|
+
} else {
|
|
107
|
+
path.push(p);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return path;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
static exposeToGlobal(): void {
|
|
115
|
+
if (typeof window !== "undefined") {
|
|
116
|
+
(window as any).Fodat = Fodat;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (typeof window !== "undefined") {
|
|
122
|
+
(window as any).Fodat = Fodat;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
const globalFunctModule = {
|
|
129
|
+
default: Fodat,
|
|
130
|
+
Fodat: Fodat,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
const __bundledModules = globalFunctModule;
|
|
135
|
+
|
|
136
|
+
if (typeof global !== 'undefined') {
|
|
137
|
+
(global as any).default = Fodat;
|
|
138
|
+
(global as any).Fodat = Fodat;
|
|
139
|
+
(global as any).__bundledModules = __bundledModules;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (typeof window !== "undefined") {
|
|
143
|
+
(window as any).default = Fodat;
|
|
144
|
+
(window as any).Fodat = Fodat;
|
|
145
|
+
(window as any).__bundledModules = __bundledModules;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (typeof exports !== 'undefined') {
|
|
149
|
+
exports.default = Fodat;
|
|
150
|
+
exports.Fodat = Fodat;
|
|
151
|
+
}
|
|
152
|
+
return globalFunctModule;
|
|
153
|
+
|
|
154
|
+
})(typeof global !== 'undefined' ? global :
|
|
155
|
+
typeof window !== 'undefined' ? window :
|
|
156
|
+
typeof self !== 'undefined' ? self :
|
|
157
|
+
typeof globalThis !== 'undefined' ? globalThis :
|
|
158
|
+
{});
|
|
159
|
+
|
|
160
|
+
type FodatElementTypeGF = typeof globalFunct.Fodat;
|
|
161
|
+
|
|
162
|
+
type DefaultElementTypeGF = typeof globalFunct.default;
|
|
163
|
+
|
|
164
|
+
const FodatElementGF: FodatElementTypeGF = globalFunct.Fodat;
|
|
165
|
+
|
|
166
|
+
const defaultElementGF: DefaultElementTypeGF = globalFunct.default;
|
|
167
|
+
|
|
168
|
+
export {
|
|
169
|
+
defaultElementGF as default,
|
|
170
|
+
FodatElementGF as Fodat,
|
|
171
|
+
};
|
|
172
|
+
export type {
|
|
173
|
+
DefaultElementTypeGF,
|
|
174
|
+
FodatElementTypeGF,
|
|
175
|
+
};
|