We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 506e38a commit 93c02feCopy full SHA for 93c02fe
src/sdk.ts
@@ -175,20 +175,18 @@ export const listValItems = memoize(async (
175
branchId: string,
176
version: number,
177
): Promise<ValTown.Vals.FileRetrieveResponse[]> => {
178
- const files: ValTown.Vals.FileRetrieveResponse[] = [];
179
-
180
branchId = branchId ||
181
(await branchNameToBranch(valId, DEFAULT_BRANCH_NAME)
182
- .then((resp) => resp.id))!;
+ .then((resp) => resp.id));
183
184
- for await (
185
- const file of sdk.vals.files.retrieve(valId, {
+ const files = await Array.fromAsync(
+ sdk.vals.files.retrieve(valId, {
186
path: "",
187
branch_id: branchId,
188
version,
189
recursive: true,
190
- })
191
- ) files.push(file);
+ }),
+ );
192
193
return files;
194
});
0 commit comments