MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / list

Function list

src/background/sync/dropbox.js:50–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 if (res.status !== 409) throw res;
49 },
50 async list() {
51 let files = [];
52 let data = await this.loadData({
53 method: 'POST',
54 url: 'https://api.dropboxapi.com/2/files/list_folder',
55 body: {
56 path: '',
57 },
58 responseType: 'json',
59 });
60 files = [
61 ...files,
62 ...data.entries
63 .filter((item) => item['.tag'] === 'file' && isScriptFile(item.name))
64 .map(normalize),
65 ];
66 while (data.has_more) {
67 data = await this.loadData({
68 method: 'POST',
69 url: 'https://api.dropboxapi.com/2/files/list_folder/continue',
70 body: {
71 cursor: data.cursor,
72 },
73 responseType: 'json',
74 });
75 files = [
76 ...files,
77 ...data.entries
78 .filter((item) => item['.tag'] === 'file' && isScriptFile(item.name))
79 .map(normalize),
80 ];
81 }
82 return files;
83 },
84 get(item) {
85 const name = getItemFilename(item);
86 return this.loadData({

Callers

nothing calls this directly

Calls 3

isScriptFileFunction · 0.90
mapMethod · 0.80
filterMethod · 0.80

Tested by

no test coverage detected