@nestia/editor 12.0.0-rc.2 → 12.0.0-rc.4
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/LICENSE +21 -21
- package/dist/assets/index-Wyu3BnMf.js +4289 -0
- package/dist/index.html +19 -19
- package/lib/NestiaEditorApplication.mjs +66 -3
- package/lib/NestiaEditorApplication.mjs.map +1 -1
- package/lib/NestiaEditorIframe.js +11 -17
- package/lib/NestiaEditorIframe.js.map +1 -1
- package/lib/NestiaEditorIframe.mjs +159 -3
- package/lib/NestiaEditorIframe.mjs.map +1 -1
- package/lib/NestiaEditorModule.mjs +51 -3
- package/lib/NestiaEditorModule.mjs.map +1 -1
- package/lib/NestiaEditorUploader.js +4 -11
- package/lib/NestiaEditorUploader.js.map +1 -1
- package/lib/NestiaEditorUploader.mjs +129 -3
- package/lib/NestiaEditorUploader.mjs.map +1 -1
- package/lib/index.mjs +4 -2
- package/lib/internal/NestiaEditorArchiver.d.ts +20 -0
- package/lib/internal/NestiaEditorArchiver.js +38 -0
- package/lib/internal/NestiaEditorArchiver.js.map +1 -0
- package/lib/internal/NestiaEditorArchiver.mjs +24 -0
- package/lib/internal/NestiaEditorArchiver.mjs.map +1 -0
- package/lib/internal/NestiaEditorComposer.mjs +52 -3
- package/lib/internal/NestiaEditorComposer.mjs.map +1 -1
- package/lib/internal/NestiaEditorFileUploader.mjs +43 -3
- package/lib/internal/NestiaEditorFileUploader.mjs.map +1 -1
- package/lib/main.mjs +9 -3
- package/lib/main.mjs.map +1 -1
- package/package.json +9 -12
- package/src/NestiaEditorApplication.tsx +94 -94
- package/src/NestiaEditorIframe.tsx +258 -245
- package/src/NestiaEditorModule.ts +136 -136
- package/src/NestiaEditorUploader.tsx +146 -154
- package/src/index.ts +3 -3
- package/src/internal/NestiaEditorArchiver.ts +43 -0
- package/src/internal/NestiaEditorComposer.ts +89 -89
- package/src/internal/NestiaEditorFileUploader.tsx +65 -65
- package/src/main.tsx +10 -10
- package/src/typings/react-mui-fileuploader.d.ts +27 -27
- package/src/vite-env.d.ts +1 -1
- package/README.md +0 -93
- package/dist/assets/index-tCs1FGcC.js +0 -4318
- package/lib/NestiaEditorApplication2.mjs +0 -86
- package/lib/NestiaEditorApplication2.mjs.map +0 -1
- package/lib/NestiaEditorIframe2.mjs +0 -139
- package/lib/NestiaEditorIframe2.mjs.map +0 -1
- package/lib/NestiaEditorModule2.mjs +0 -124
- package/lib/NestiaEditorModule2.mjs.map +0 -1
- package/lib/NestiaEditorUploader2.mjs +0 -90
- package/lib/NestiaEditorUploader2.mjs.map +0 -1
- package/lib/_virtual/NestiaEditorApplication.mjs +0 -4
- package/lib/_virtual/NestiaEditorApplication.mjs.map +0 -1
- package/lib/_virtual/NestiaEditorComposer.mjs +0 -4
- package/lib/_virtual/NestiaEditorComposer.mjs.map +0 -1
- package/lib/_virtual/NestiaEditorFileUploader.mjs +0 -4
- package/lib/_virtual/NestiaEditorFileUploader.mjs.map +0 -1
- package/lib/_virtual/NestiaEditorIframe.mjs +0 -4
- package/lib/_virtual/NestiaEditorIframe.mjs.map +0 -1
- package/lib/_virtual/NestiaEditorModule.mjs +0 -4
- package/lib/_virtual/NestiaEditorModule.mjs.map +0 -1
- package/lib/_virtual/NestiaEditorUploader.mjs +0 -4
- package/lib/_virtual/NestiaEditorUploader.mjs.map +0 -1
- package/lib/_virtual/_commonjsHelpers.mjs +0 -35
- package/lib/_virtual/_commonjsHelpers.mjs.map +0 -1
- package/lib/_virtual/_js-yaml.mjs +0 -7
- package/lib/_virtual/_js-yaml.mjs.map +0 -1
- package/lib/_virtual/_node_fs.mjs +0 -7
- package/lib/_virtual/_node_fs.mjs.map +0 -1
- package/lib/_virtual/_react-mui-fileuploader.mjs +0 -7
- package/lib/_virtual/_react-mui-fileuploader.mjs.map +0 -1
- package/lib/_virtual/_react.mjs +0 -7
- package/lib/_virtual/_react.mjs.map +0 -1
- package/lib/_virtual/client.mjs +0 -7
- package/lib/_virtual/client.mjs.map +0 -1
- package/lib/_virtual/estree.mjs +0 -7
- package/lib/_virtual/estree.mjs.map +0 -1
- package/lib/_virtual/index.mjs +0 -4
- package/lib/_virtual/index.mjs.map +0 -1
- package/lib/_virtual/jsx-runtime.mjs +0 -7
- package/lib/_virtual/jsx-runtime.mjs.map +0 -1
- package/lib/_virtual/main.mjs +0 -4
- package/lib/_virtual/main.mjs.map +0 -1
- package/lib/_virtual/material.mjs +0 -7
- package/lib/_virtual/material.mjs.map +0 -1
- package/lib/_virtual/migrate.mjs +0 -7
- package/lib/_virtual/migrate.mjs.map +0 -1
- package/lib/_virtual/sdk.mjs +0 -7
- package/lib/_virtual/sdk.mjs.map +0 -1
- package/lib/_virtual/standalone.mjs +0 -7
- package/lib/_virtual/standalone.mjs.map +0 -1
- package/lib/_virtual/typescript.mjs +0 -7
- package/lib/_virtual/typescript.mjs.map +0 -1
- package/lib/index.mjs.map +0 -1
- package/lib/index2.mjs +0 -35
- package/lib/index2.mjs.map +0 -1
- package/lib/internal/NestiaEditorComposer2.mjs +0 -110
- package/lib/internal/NestiaEditorComposer2.mjs.map +0 -1
- package/lib/internal/NestiaEditorFileUploader2.mjs +0 -51
- package/lib/internal/NestiaEditorFileUploader2.mjs.map +0 -1
- package/lib/main2.mjs +0 -16
- package/lib/main2.mjs.map +0 -1
|
@@ -1,245 +1,258 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Alert,
|
|
3
|
-
AlertTitle,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@typia/interface";
|
|
13
|
-
import { load } from "js-yaml";
|
|
14
|
-
import React from "react";
|
|
15
|
-
import { IValidation } from "typia";
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
>(
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
return map;
|
|
245
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Alert,
|
|
3
|
+
AlertTitle,
|
|
4
|
+
Button,
|
|
5
|
+
CircularProgress,
|
|
6
|
+
Step,
|
|
7
|
+
StepContent,
|
|
8
|
+
StepLabel,
|
|
9
|
+
Stepper,
|
|
10
|
+
Typography,
|
|
11
|
+
} from "@mui/material";
|
|
12
|
+
import { OpenApiV3, OpenApiV3_1, SwaggerV2 } from "@typia/interface";
|
|
13
|
+
import { load } from "js-yaml";
|
|
14
|
+
import React from "react";
|
|
15
|
+
import { IValidation } from "typia";
|
|
16
|
+
|
|
17
|
+
import { NestiaEditorArchiver } from "./internal/NestiaEditorArchiver";
|
|
18
|
+
import { NestiaEditorComposer } from "./internal/NestiaEditorComposer";
|
|
19
|
+
|
|
20
|
+
export function NestiaEditorIframe(props: NestiaEditorIframe.IProps) {
|
|
21
|
+
const [step, setStep] = React.useState(0);
|
|
22
|
+
const [fetchError, setFetchError] = React.useState<string | null>(null);
|
|
23
|
+
const [operations, setOperationCount] = React.useState<
|
|
24
|
+
Record<string, number>
|
|
25
|
+
>({});
|
|
26
|
+
const [composerError, setComposerError] = React.useState<any | null>(null);
|
|
27
|
+
const [files, setFiles] = React.useState<Record<string, string> | null>(null);
|
|
28
|
+
const archive: string = NestiaEditorArchiver.name(
|
|
29
|
+
props.package ?? "@ORGANIZATION/PROJECT",
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
(async () => {
|
|
34
|
+
// LOADING OPENAPI DOCUMENTS
|
|
35
|
+
setStep(0);
|
|
36
|
+
const document:
|
|
37
|
+
| SwaggerV2.IDocument
|
|
38
|
+
| OpenApiV3.IDocument
|
|
39
|
+
| OpenApiV3_1.IDocument
|
|
40
|
+
| string =
|
|
41
|
+
typeof props.swagger === "string"
|
|
42
|
+
? await getDocument(props.swagger)
|
|
43
|
+
: props.swagger;
|
|
44
|
+
if (typeof document === "string") {
|
|
45
|
+
setFetchError(document);
|
|
46
|
+
return;
|
|
47
|
+
} else setOperationCount(aggregateOperation(document));
|
|
48
|
+
|
|
49
|
+
// GENERATING SOFTWARE DEVELOPMENT KIT
|
|
50
|
+
setStep(1);
|
|
51
|
+
const result: IValidation<NestiaEditorComposer.IOutput> =
|
|
52
|
+
await (async () => {
|
|
53
|
+
try {
|
|
54
|
+
return await NestiaEditorComposer[props.mode ?? "sdk"]({
|
|
55
|
+
document,
|
|
56
|
+
keyword: props.keyword ?? true,
|
|
57
|
+
simulate: props.simulate ?? true,
|
|
58
|
+
e2e: props.e2e ?? true,
|
|
59
|
+
package: props.package ?? "@ORGANIZATION/PROJECT",
|
|
60
|
+
});
|
|
61
|
+
} catch (exp) {
|
|
62
|
+
return {
|
|
63
|
+
success: false,
|
|
64
|
+
errors: exp as any,
|
|
65
|
+
data: undefined,
|
|
66
|
+
} satisfies IValidation.IFailure;
|
|
67
|
+
}
|
|
68
|
+
})();
|
|
69
|
+
if (result.success === false) {
|
|
70
|
+
setComposerError(result.errors);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// READY TO DOWNLOAD
|
|
75
|
+
setStep(2);
|
|
76
|
+
setFiles(result.data.files);
|
|
77
|
+
})().catch((exp) => {
|
|
78
|
+
console.error("unknown error", exp);
|
|
79
|
+
});
|
|
80
|
+
}, []);
|
|
81
|
+
return (
|
|
82
|
+
<div
|
|
83
|
+
style={{
|
|
84
|
+
width: "100%",
|
|
85
|
+
height: "100%",
|
|
86
|
+
overflow: "hidden",
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<div
|
|
90
|
+
style={{
|
|
91
|
+
padding: 25,
|
|
92
|
+
overflow: "auto",
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
<Typography variant="h4">Nestia Editor</Typography>
|
|
96
|
+
<hr />
|
|
97
|
+
<br />
|
|
98
|
+
<Stepper activeStep={step} orientation="vertical" nonLinear={true}>
|
|
99
|
+
<Step key={0}>
|
|
100
|
+
<StepLabel>
|
|
101
|
+
<Typography variant="h5">Loading OpenAPI Document</Typography>
|
|
102
|
+
</StepLabel>
|
|
103
|
+
<StepContent>
|
|
104
|
+
<br />
|
|
105
|
+
<CircularProgress size={100} color="success" />
|
|
106
|
+
<br />
|
|
107
|
+
<br />
|
|
108
|
+
{typeof props.swagger === "string" ? (
|
|
109
|
+
<>
|
|
110
|
+
<p>Fetching OpenAPI Document from</p>
|
|
111
|
+
<p>
|
|
112
|
+
<a href={props.swagger} target="_blank">
|
|
113
|
+
{props.swagger}
|
|
114
|
+
</a>
|
|
115
|
+
</p>
|
|
116
|
+
</>
|
|
117
|
+
) : (
|
|
118
|
+
"Delivering OpenAPI Document to the composer"
|
|
119
|
+
)}
|
|
120
|
+
{fetchError !== null ? (
|
|
121
|
+
<Alert severity="error">
|
|
122
|
+
<AlertTitle>Fetch Error</AlertTitle>
|
|
123
|
+
{fetchError}
|
|
124
|
+
</Alert>
|
|
125
|
+
) : null}
|
|
126
|
+
</StepContent>
|
|
127
|
+
</Step>
|
|
128
|
+
<Step key={1}>
|
|
129
|
+
<StepLabel>
|
|
130
|
+
<Typography variant="h5">
|
|
131
|
+
Generating Software Development Kit
|
|
132
|
+
</Typography>
|
|
133
|
+
</StepLabel>
|
|
134
|
+
<StepContent>
|
|
135
|
+
<br />
|
|
136
|
+
<CircularProgress size={100} color="success" />
|
|
137
|
+
<br />
|
|
138
|
+
<br />
|
|
139
|
+
Generating SDK functions...
|
|
140
|
+
<br />
|
|
141
|
+
<ul>
|
|
142
|
+
<li>
|
|
143
|
+
total operations: #
|
|
144
|
+
{Object.values(operations)
|
|
145
|
+
.reduce((a, b) => a + b, 0)
|
|
146
|
+
.toLocaleString()}
|
|
147
|
+
</li>
|
|
148
|
+
{Object.entries(operations).map(([method, count]) => (
|
|
149
|
+
<li>
|
|
150
|
+
{method}: #{count.toLocaleString()}
|
|
151
|
+
</li>
|
|
152
|
+
))}
|
|
153
|
+
</ul>
|
|
154
|
+
{composerError !== null ? (
|
|
155
|
+
<>
|
|
156
|
+
<br />
|
|
157
|
+
<Alert severity="error">
|
|
158
|
+
<AlertTitle>Composition Error</AlertTitle>
|
|
159
|
+
<pre>{JSON.stringify(composerError, null, 2)}</pre>
|
|
160
|
+
</Alert>
|
|
161
|
+
</>
|
|
162
|
+
) : null}
|
|
163
|
+
</StepContent>
|
|
164
|
+
</Step>
|
|
165
|
+
<Step key={2}>
|
|
166
|
+
<StepLabel>
|
|
167
|
+
<Typography variant="h5">
|
|
168
|
+
Downloading TypeScript Project
|
|
169
|
+
</Typography>
|
|
170
|
+
</StepLabel>
|
|
171
|
+
<StepContent>
|
|
172
|
+
<br />
|
|
173
|
+
{files !== null ? (
|
|
174
|
+
<>
|
|
175
|
+
<p>
|
|
176
|
+
{Object.keys(files).length.toLocaleString()} files are
|
|
177
|
+
ready.
|
|
178
|
+
</p>
|
|
179
|
+
<Button
|
|
180
|
+
variant="contained"
|
|
181
|
+
color="success"
|
|
182
|
+
size="large"
|
|
183
|
+
onClick={() =>
|
|
184
|
+
NestiaEditorArchiver.download({
|
|
185
|
+
name: archive,
|
|
186
|
+
files,
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
>
|
|
190
|
+
Download {archive}
|
|
191
|
+
</Button>
|
|
192
|
+
</>
|
|
193
|
+
) : null}
|
|
194
|
+
</StepContent>
|
|
195
|
+
</Step>
|
|
196
|
+
</Stepper>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
export namespace NestiaEditorIframe {
|
|
202
|
+
export interface IProps {
|
|
203
|
+
swagger:
|
|
204
|
+
| string
|
|
205
|
+
| SwaggerV2.IDocument
|
|
206
|
+
| OpenApiV3.IDocument
|
|
207
|
+
| OpenApiV3_1.IDocument;
|
|
208
|
+
package?: string;
|
|
209
|
+
keyword?: boolean;
|
|
210
|
+
simulate?: boolean;
|
|
211
|
+
e2e?: boolean;
|
|
212
|
+
|
|
213
|
+
/** @internal */
|
|
214
|
+
mode?: "nest" | "sdk";
|
|
215
|
+
|
|
216
|
+
/** @internal */
|
|
217
|
+
files?: Record<string, string>;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const getDocument = async (
|
|
222
|
+
url: string,
|
|
223
|
+
): Promise<
|
|
224
|
+
SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument | string
|
|
225
|
+
> => {
|
|
226
|
+
try {
|
|
227
|
+
const response: Response = await fetch(url);
|
|
228
|
+
if (response.status !== 200) return await response.text();
|
|
229
|
+
else if (url.endsWith(".yaml")) {
|
|
230
|
+
const text: string = await response.text();
|
|
231
|
+
return load(text) as OpenApiV3.IDocument;
|
|
232
|
+
}
|
|
233
|
+
return await response.json();
|
|
234
|
+
} catch (error) {
|
|
235
|
+
if (error instanceof Error) return error.message;
|
|
236
|
+
return "Unknown error";
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const aggregateOperation = (
|
|
241
|
+
document: SwaggerV2.IDocument | OpenApiV3.IDocument | OpenApiV3_1.IDocument,
|
|
242
|
+
): Record<string, number> => {
|
|
243
|
+
const map: Record<string, number> = {};
|
|
244
|
+
if (!(typeof document === "object" && document !== null)) return map;
|
|
245
|
+
for (const collection of Object.values(document.paths ?? {}))
|
|
246
|
+
if (typeof collection === "object" && collection !== null)
|
|
247
|
+
for (const [method] of Object.entries(collection))
|
|
248
|
+
if (
|
|
249
|
+
method === "head" ||
|
|
250
|
+
method === "get" ||
|
|
251
|
+
method === "post" ||
|
|
252
|
+
method === "patch" ||
|
|
253
|
+
method === "put" ||
|
|
254
|
+
method === "delete"
|
|
255
|
+
)
|
|
256
|
+
map[method] = (map[method] ?? 0) + 1;
|
|
257
|
+
return map;
|
|
258
|
+
};
|