1 | var hooks = { |
||
2 | /***************** express *****************/ |
||
3 | beforeExpress: (port, abe) => { |
||
0 ignored issues
–
show
|
|||
4 | return port |
||
5 | }, |
||
6 | afterExpress: (app, express, abe) => { |
||
0 ignored issues
–
show
|
|||
7 | return app |
||
8 | }, |
||
9 | beforeRoute: (req, res, next, abe) => { |
||
0 ignored issues
–
show
|
|||
10 | return req |
||
11 | }, |
||
12 | beforeAddRoute: (router, abe) => { |
||
0 ignored issues
–
show
|
|||
13 | return router |
||
14 | }, |
||
15 | afterAddRoute: (router, abe) => { |
||
0 ignored issues
–
show
|
|||
16 | return router |
||
17 | }, |
||
18 | |||
19 | /***************** preview *****************/ |
||
20 | beforePreview: (html, req, res, next, abe) => { |
||
0 ignored issues
–
show
|
|||
21 | return html |
||
22 | }, |
||
23 | |||
24 | /***************** create *****************/ |
||
25 | beforeDeleteFile: (filePath, abe) => { |
||
0 ignored issues
–
show
|
|||
26 | return filePath |
||
27 | }, |
||
28 | afterDeleteFile: (path, json, abe) => { |
||
0 ignored issues
–
show
|
|||
29 | return path |
||
30 | }, |
||
31 | |||
32 | /***************** publish *****************/ |
||
33 | beforeReject: (json, filePath, tplPath, abe) => { |
||
0 ignored issues
–
show
|
|||
34 | return json |
||
35 | }, |
||
36 | afterReject: (result, abe) => { |
||
0 ignored issues
–
show
|
|||
37 | return result |
||
38 | }, |
||
39 | |||
40 | /***************** publish *****************/ |
||
41 | beforePublish: (json, filePath, tplPath, abe) => { |
||
0 ignored issues
–
show
|
|||
42 | return json |
||
43 | }, |
||
44 | afterPublish: (result, abe) => { |
||
0 ignored issues
–
show
|
|||
45 | return result |
||
46 | }, |
||
47 | |||
48 | /***************** unpublish *****************/ |
||
49 | beforeUnpublish: (filePath, abe) => { |
||
0 ignored issues
–
show
|
|||
50 | return filePath |
||
51 | }, |
||
52 | afterUnpublish: (path, json, abe) => { |
||
0 ignored issues
–
show
|
|||
53 | return path |
||
54 | }, |
||
55 | |||
56 | /***************** create *****************/ |
||
57 | beforeCreate: (filePath, template, path, name, req, forceJson, abe) => { |
||
0 ignored issues
–
show
|
|||
58 | return filePath |
||
59 | }, |
||
60 | afterCreate: (json, text, path, name, req, forceJson, abe) => { |
||
0 ignored issues
–
show
|
|||
61 | return json |
||
62 | }, |
||
63 | |||
64 | /***************** duplicate *****************/ |
||
65 | beforeDuplicate: (oldFilePath, template, path, name, req, deleteFiles, abe) => { |
||
0 ignored issues
–
show
|
|||
66 | // if deleteFiles this is an update not a duplicate |
||
67 | return oldFilePath |
||
68 | }, |
||
69 | afterDuplicate: (json, oldFilePath, template, path, name, req, deleteFiles, abe) => { |
||
0 ignored issues
–
show
|
|||
70 | return json |
||
71 | }, |
||
72 | |||
73 | /***************** update *****************/ |
||
74 | beforeUpdate: (json, oldFilePath, template, path, name, req, deleteFiles, abe) => { |
||
0 ignored issues
–
show
|
|||
75 | return json |
||
76 | }, |
||
77 | |||
78 | /***************** save *****************/ |
||
79 | beforeFirstSave: (postUrl, body, json, abe) => { |
||
0 ignored issues
–
show
|
|||
80 | return { |
||
81 | postUrl: postUrl, |
||
82 | json: json |
||
83 | } |
||
84 | }, |
||
85 | beforeSave: (obj, abe) => { |
||
0 ignored issues
–
show
|
|||
86 | return obj |
||
87 | }, |
||
88 | afterSave: (obj, abe) => { |
||
0 ignored issues
–
show
|
|||
89 | return obj |
||
90 | }, |
||
91 | beforeSaveImage: (folderWebPath, abe) => { |
||
0 ignored issues
–
show
|
|||
92 | return folderWebPath |
||
93 | }, |
||
94 | afterSaveImage: (resp, abe) => { |
||
0 ignored issues
–
show
|
|||
95 | return resp |
||
96 | }, |
||
97 | afterPageSaveCompile: (tmp, json, abe) => { |
||
0 ignored issues
–
show
|
|||
98 | return tmp |
||
99 | }, |
||
100 | afterPageEditorCompile: (tmp, json, abe) => { |
||
0 ignored issues
–
show
|
|||
101 | return tmp |
||
102 | }, |
||
103 | |||
104 | /***************** Manager *****************/ |
||
105 | beforeGetAllFilesDraft: (drafted, abe) => { |
||
0 ignored issues
–
show
|
|||
106 | return drafted |
||
107 | }, |
||
108 | beforeGetAllFilesPublished: (published, abe) => { |
||
0 ignored issues
–
show
|
|||
109 | return published |
||
110 | }, |
||
111 | afterGetAllFiles: (merged, abe) => { |
||
0 ignored issues
–
show
|
|||
112 | return merged |
||
113 | }, |
||
114 | |||
115 | /***************** Editor *****************/ |
||
116 | beforeImport: (file, config, ctx, abe) => { |
||
0 ignored issues
–
show
|
|||
117 | return file |
||
118 | }, |
||
119 | afterImport: (res, file, config, ctx, abe) => { |
||
0 ignored issues
–
show
|
|||
120 | return res |
||
121 | }, |
||
122 | afterHandlebarsHelpers: (Handlebars, abe) => { |
||
0 ignored issues
–
show
|
|||
123 | return Handlebars |
||
124 | }, |
||
125 | beforeEditorInput: (params, abe) => { |
||
0 ignored issues
–
show
|
|||
126 | return params |
||
127 | }, |
||
128 | afterEditorInput: (htmlString, params, abe) => { |
||
0 ignored issues
–
show
|
|||
129 | return htmlString |
||
130 | }, |
||
131 | |||
132 | beforeAbeAttributes: (str, json, abe) => { |
||
0 ignored issues
–
show
|
|||
133 | return str |
||
134 | }, |
||
135 | afterAbeAttributes: (obj, str, json, abe) => { |
||
0 ignored issues
–
show
|
|||
136 | return obj |
||
137 | }, |
||
138 | beforeEditorFormBlocks: (json, text, abe) => { |
||
0 ignored issues
–
show
|
|||
139 | return json |
||
140 | }, |
||
141 | afterEditorFormBlocks: (blocks, json, text, abe) => { |
||
0 ignored issues
–
show
|
|||
142 | return blocks |
||
143 | }, |
||
144 | beforeListPage: (file, index, text) => { |
||
0 ignored issues
–
show
|
|||
145 | return file |
||
146 | }, |
||
147 | afterListPageDraft: (workflow, file, index, text) => { |
||
0 ignored issues
–
show
|
|||
148 | return workflow |
||
149 | }, |
||
150 | afterListPage: (res, file, index, text) => { |
||
0 ignored issues
–
show
|
|||
151 | return res |
||
152 | }, |
||
153 | afterVariables: (EditorVariables, abe) => { |
||
0 ignored issues
–
show
|
|||
154 | return EditorVariables |
||
155 | }, |
||
156 | |||
157 | /***************** json *****************/ |
||
158 | beforeGetJson: (path, abe) => { |
||
0 ignored issues
–
show
|
|||
159 | return path |
||
160 | }, |
||
161 | afterGetJson: (json, abe) => { |
||
0 ignored issues
–
show
|
|||
162 | return json |
||
163 | }, |
||
164 | beforeUpdateJson: (jsonFilesArray, abe) => { |
||
0 ignored issues
–
show
|
|||
165 | return jsonFilesArray |
||
166 | }, |
||
167 | |||
168 | /***************** text *****************/ |
||
169 | beforeGetTemplate: (file, abe) => { |
||
0 ignored issues
–
show
|
|||
170 | return file |
||
171 | }, |
||
172 | afterGetTemplate: (text, abe) => { |
||
0 ignored issues
–
show
|
|||
173 | return text |
||
174 | }, |
||
175 | |||
176 | /***************** Page *****************/ |
||
177 | afterAddSourcePage: (json, text, abe) => { |
||
0 ignored issues
–
show
|
|||
178 | return json |
||
179 | }, |
||
180 | |||
181 | beforePageJson: (json, abe) => { |
||
0 ignored issues
–
show
|
|||
182 | return json |
||
183 | } |
||
184 | } |
||
185 | |||
186 | export default hooks |
||
187 |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.