w-dwdata-tweqod 1.0.0

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.
Files changed (53) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.jsdoc +25 -0
  5. package/LICENSE +21 -0
  6. package/README.md +24 -0
  7. package/SECURITY.md +5 -0
  8. package/babel.config.js +16 -0
  9. package/dist/w-dwdata-tweqod.umd.js +8 -0
  10. package/dist/w-dwdata-tweqod.umd.js.map +1 -0
  11. package/docs/WDwdataTweqod.mjs.html +445 -0
  12. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  19. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  29. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  30. package/docs/global.html +779 -0
  31. package/docs/index.html +84 -0
  32. package/docs/scripts/collapse.js +39 -0
  33. package/docs/scripts/commonNav.js +28 -0
  34. package/docs/scripts/linenumber.js +25 -0
  35. package/docs/scripts/nav.js +12 -0
  36. package/docs/scripts/polyfill.js +4 -0
  37. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  38. package/docs/scripts/prettify/lang-css.js +2 -0
  39. package/docs/scripts/prettify/prettify.js +28 -0
  40. package/docs/scripts/search.js +99 -0
  41. package/docs/styles/jsdoc.css +776 -0
  42. package/docs/styles/prettify.css +80 -0
  43. package/g.downloadEqs.mjs +21 -0
  44. package/g.mjs +60 -0
  45. package/package.json +33 -0
  46. package/script.txt +17 -0
  47. package/src/WDwdataTweqod.mjs +373 -0
  48. package/src/downloadEqs.mjs +168 -0
  49. package/test/WDwdataTweq.test.mjs +137 -0
  50. package/toolg/addVersion.mjs +4 -0
  51. package/toolg/cleanFolder.mjs +4 -0
  52. package/toolg/gDistRollup.mjs +26 -0
  53. package/toolg/modifyReadme.mjs +4 -0
@@ -0,0 +1,80 @@
1
+ .pln {
2
+ color: #ddd;
3
+ }
4
+
5
+ /* string content */
6
+ .str {
7
+ color: #61ce3c;
8
+ }
9
+
10
+ /* a keyword */
11
+ .kwd {
12
+ color: #fbde2d;
13
+ }
14
+
15
+ /* a comment */
16
+ .com {
17
+ color: #aeaeae;
18
+ }
19
+
20
+ /* a type name */
21
+ .typ {
22
+ color: #8da6ce;
23
+ }
24
+
25
+ /* a literal value */
26
+ .lit {
27
+ color: #fbde2d;
28
+ }
29
+
30
+ /* punctuation */
31
+ .pun {
32
+ color: #ddd;
33
+ }
34
+
35
+ /* lisp open bracket */
36
+ .opn {
37
+ color: #000000;
38
+ }
39
+
40
+ /* lisp close bracket */
41
+ .clo {
42
+ color: #000000;
43
+ }
44
+
45
+ /* a markup tag name */
46
+ .tag {
47
+ color: #8da6ce;
48
+ }
49
+
50
+ /* a markup attribute name */
51
+ .atn {
52
+ color: #fbde2d;
53
+ }
54
+
55
+ /* a markup attribute value */
56
+ .atv {
57
+ color: #ddd;
58
+ }
59
+
60
+ /* a declaration */
61
+ .dec {
62
+ color: #EF5050;
63
+ }
64
+
65
+ /* a variable name */
66
+ .var {
67
+ color: #c82829;
68
+ }
69
+
70
+ /* a function name */
71
+ .fun {
72
+ color: #4271ae;
73
+ }
74
+
75
+ /* Specify class=linenums on a pre to get line numbering */
76
+ ol.linenums {
77
+ margin-top: 0;
78
+ margin-bottom: 0;
79
+ padding-bottom: 2px;
80
+ }
@@ -0,0 +1,21 @@
1
+ import path from 'path'
2
+ import fs from 'fs'
3
+ import _ from 'lodash-es'
4
+ import w from 'wsemi'
5
+ import downloadEqs from './src/downloadEqs.mjs'
6
+
7
+
8
+ let j = fs.readFileSync('../_data/settings.json', 'utf8')
9
+ let st = JSON.parse(j)
10
+ let token = _.get(st, 'token')
11
+
12
+ let fd = `./_dwAttime`
13
+ if (!w.fsIsFolder(fd)) {
14
+ w.fsCreateFolder(fd)
15
+ }
16
+
17
+ let eqs = await downloadEqs(token, fd)
18
+ console.log('eqs', eqs)
19
+
20
+
21
+ //node g.downloadEqs.mjs
package/g.mjs ADDED
@@ -0,0 +1,60 @@
1
+ // import path from 'path'
2
+ import fs from 'fs'
3
+ import _ from 'lodash-es'
4
+ import w from 'wsemi'
5
+ import WDwdataTweqod from './src/WDwdataTweqod.mjs'
6
+
7
+
8
+ let j = fs.readFileSync('../_data/settings.json', 'utf8')
9
+ let st = JSON.parse(j)
10
+ let token = _.get(st, 'token')
11
+
12
+ //fdDwStorage
13
+ let fdDwStorage = `./_dwStorage`
14
+ w.fsCleanFolder(fdDwStorage)
15
+
16
+ //fdDwAttime
17
+ let fdDwAttime = `./_dwAttime`
18
+ w.fsCleanFolder(fdDwAttime)
19
+
20
+ //fdDwCurrent
21
+ let fdDwCurrent = `./_dwCurrent`
22
+ w.fsCleanFolder(fdDwCurrent)
23
+
24
+ //fdResult
25
+ let fdResult = './_result'
26
+ w.fsCleanFolder(fdResult)
27
+
28
+ let opt = {
29
+ fdDwStorage,
30
+ fdDwAttime,
31
+ fdDwCurrent,
32
+ fdResult,
33
+ // funDownload,
34
+ // funGetCurrent,
35
+ // funRemove,
36
+ // funAdd,
37
+ // funModify,
38
+ }
39
+ let ev = await WDwdataTweqod(token, opt)
40
+ .catch((err) => {
41
+ console.log(err)
42
+ })
43
+ ev.on('change', (msg) => {
44
+ delete msg.type
45
+ console.log('change', msg)
46
+ })
47
+ // change { event: 'start', msg: 'running...' }
48
+ // change { event: 'proc-callfun-download', msg: 'start...' }
49
+ // change { event: 'proc-callfun-download', msg: 'done' }
50
+ // change { event: 'proc-callfun-getCurrent', msg: 'start...' }
51
+ // change { event: 'proc-callfun-getCurrent', msg: 'done' }
52
+ // change { event: 'compare', msg: 'start...' }
53
+ // change { event: 'compare', msg: 'done' }
54
+ // change { event: 'proc-add-callfun-add', id: '114101', msg: 'start...' }
55
+ // change { event: 'proc-add-callfun-add', id: '114101', msg: 'done' }
56
+ // change { event: 'proc-add-callfun-add', id: '114102', msg: 'start...' }
57
+ // change { event: 'proc-add-callfun-add', id: '114102', msg: 'done' }
58
+ // ...
59
+
60
+ //node g.mjs
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "w-dwdata-tweqod",
3
+ "version": "1.0.0",
4
+ "main": "dist/w-dwdata-tweqod.umd.js",
5
+ "dependencies": {
6
+ "axios": "^1.11.0",
7
+ "lodash-es": "^4.17.21",
8
+ "w-dwdata-builder": "^1.0.1",
9
+ "wsemi": "^1.8.18"
10
+ },
11
+ "devDependencies": {
12
+ "w-package-tools": "^1.1.2"
13
+ },
14
+ "scripts": {
15
+ "test": "mocha --parallel --timeout 60000",
16
+ "deploy": "gh-pages -d docs"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/yuda-lyu/w-dwdata-tweqod.git"
21
+ },
22
+ "keywords": [
23
+ "package",
24
+ "tool",
25
+ "download",
26
+ "data",
27
+ "tw",
28
+ "eq",
29
+ "nodejs"
30
+ ],
31
+ "author": "yuda-lyu(semisphere)",
32
+ "license": "MIT"
33
+ }
package/script.txt ADDED
@@ -0,0 +1,17 @@
1
+ #node toolg/addVersion.mjs
2
+ node toolg/modifyReadme.mjs
3
+
4
+ node toolg/cleanFolder.mjs
5
+ ./node_modules/.bin/jsdoc -c .jsdoc
6
+
7
+ node toolg/gDistRollup.mjs
8
+
9
+ git add . -A
10
+ git commit -m 'modify: '
11
+ git push origin master:master
12
+
13
+ npm run deploy
14
+
15
+ #npm test
16
+
17
+ #npm publish
@@ -0,0 +1,373 @@
1
+ import fs from 'fs'
2
+ import get from 'lodash-es/get.js'
3
+ import each from 'lodash-es/each.js'
4
+ import reverse from 'lodash-es/reverse.js'
5
+ import values from 'lodash-es/values.js'
6
+ import isestr from 'wsemi/src/isestr.mjs'
7
+ import isfun from 'wsemi/src/isfun.mjs'
8
+ import ispm from 'wsemi/src/ispm.mjs'
9
+ import haskey from 'wsemi/src/haskey.mjs'
10
+ import pmSeries from 'wsemi/src/pmSeries.mjs'
11
+ import fsIsFolder from 'wsemi/src/fsIsFolder.mjs'
12
+ import fsCopyFile from 'wsemi/src/fsCopyFile.mjs'
13
+ import fsCleanFolder from 'wsemi/src/fsCleanFolder.mjs'
14
+ import fsCreateFolder from 'wsemi/src/fsCreateFolder.mjs'
15
+ import fsDeleteFolder from 'wsemi/src/fsDeleteFolder.mjs'
16
+ import fsTreeFolder from 'wsemi/src/fsTreeFolder.mjs'
17
+ import fsGetFileXxHash from 'wsemi/src/fsGetFileXxHash.mjs'
18
+ import WDwdataBuilder from 'w-dwdata-builder/src/WDwdataBuilder.mjs'
19
+ import downloadEqs from './downloadEqs.mjs'
20
+ import fsCopyFolder from 'wsemi/src/fsCopyFolder.mjs'
21
+
22
+
23
+ /**
24
+ * 於OpenData下載台灣氣象署地震資料
25
+ *
26
+ * @param {String} token 輸入氣象署OpenData之API用token字串
27
+ * @param {Object} [opt={}] 輸入設定物件,預設{}
28
+ * @param {String} [opt.fdDwStorage] 輸入完整下載數據資料夾字串,預設'./_dwStorage'
29
+ * @param {String} [opt.fdDwAttime] 輸入當前下載供比對hash用之數據資料夾字串,預設'./_dwAttime'
30
+ * @param {String} [opt.fdDwCurrent] 輸入已下載供比對hash用之數據資料夾字串,預設'./_dwCurrent'
31
+ * @param {String} [opt.fdResult] 輸入已下載數據所連動生成數據資料夾字串,預設'./_result'
32
+ * @param {String} [opt.fdTaskCpSrc] 輸入任務狀態之來源端資料夾字串,預設'./_taskCpSrc'
33
+ * @param {Function} [opt.funDownloadEqs] 輸入自定義下載地震數據函數,回傳資料陣列
34
+ * @param {Function} [opt.funDownload] 輸入自定義當前下載之hash數據處理函數,回傳資料陣列
35
+ * @param {Function} [opt.funGetCurrent] 輸入自定義已下載之hash數據處理函數,回傳資料陣列
36
+ * @param {Function} [opt.funAdd] 輸入當有新資料時,需要連動處理之函數
37
+ * @param {Function} [opt.funModify] 輸入當有資料需更新時,需要連動處理之函數
38
+ * @param {Function} [opt.funRemove] 輸入當有資料需刪除時,需要連動處理之函數
39
+ * @returns {Object} 回傳事件物件,可呼叫函數on監聽change事件
40
+ * @example
41
+ *
42
+ * import fs from 'fs'
43
+ * import _ from 'lodash-es'
44
+ * import w from 'wsemi'
45
+ * import WDwdataTweqod from './src/WDwdataTweqod.mjs'
46
+ *
47
+ * let j = fs.readFileSync('../_data/settings.json', 'utf8')
48
+ * let st = JSON.parse(j)
49
+ * let token = _.get(st, 'token')
50
+ *
51
+ * //fdDwStorage
52
+ * let fdDwStorage = `./_dwStorage`
53
+ * w.fsCleanFolder(fdDwStorage)
54
+ *
55
+ * //fdDwAttime
56
+ * let fdDwAttime = `./_dwAttime`
57
+ * w.fsCleanFolder(fdDwAttime)
58
+ *
59
+ * //fdDwCurrent
60
+ * let fdDwCurrent = `./_dwCurrent`
61
+ * w.fsCleanFolder(fdDwCurrent)
62
+ *
63
+ * //fdResult
64
+ * let fdResult = './_result'
65
+ * w.fsCleanFolder(fdResult)
66
+ *
67
+ * let opt = {
68
+ * fdDwStorage,
69
+ * fdDwAttime,
70
+ * fdDwCurrent,
71
+ * fdResult,
72
+ * // funDownload,
73
+ * // funGetCurrent,
74
+ * // funRemove,
75
+ * // funAdd,
76
+ * // funModify,
77
+ * }
78
+ * let ev = await WDwdataTweqod(token, opt)
79
+ * .catch((err) => {
80
+ * console.log(err)
81
+ * })
82
+ * ev.on('change', (msg) => {
83
+ * delete msg.type
84
+ * console.log('change', msg)
85
+ * })
86
+ * // change { event: 'start', msg: 'running...' }
87
+ * // change { event: 'proc-callfun-download', msg: 'start...' }
88
+ * // change { event: 'proc-callfun-download', msg: 'done' }
89
+ * // change { event: 'proc-callfun-getCurrent', msg: 'start...' }
90
+ * // change { event: 'proc-callfun-getCurrent', msg: 'done' }
91
+ * // change { event: 'compare', msg: 'start...' }
92
+ * // change { event: 'compare', msg: 'done' }
93
+ * // change { event: 'proc-add-callfun-add', id: '114101', msg: 'start...' }
94
+ * // change { event: 'proc-add-callfun-add', id: '114101', msg: 'done' }
95
+ * // change { event: 'proc-add-callfun-add', id: '114102', msg: 'start...' }
96
+ * // change { event: 'proc-add-callfun-add', id: '114102', msg: 'done' }
97
+ * // ...
98
+ *
99
+ */
100
+ let WDwdataTweqod = async(token, opt = {}) => {
101
+
102
+ //fdDwStorage
103
+ let fdDwStorage = get(opt, 'fdDwStorage')
104
+ if (!isestr(fdDwStorage)) {
105
+ fdDwStorage = `./_dwStorage`
106
+ }
107
+ if (!fsIsFolder(fdDwStorage)) {
108
+ fsCreateFolder(fdDwStorage)
109
+ }
110
+
111
+ //fdDwAttime
112
+ let fdDwAttime = get(opt, 'fdDwAttime')
113
+ if (!isestr(fdDwAttime)) {
114
+ fdDwAttime = `./_dwAttime`
115
+ }
116
+ if (!fsIsFolder(fdDwAttime)) {
117
+ fsCreateFolder(fdDwAttime)
118
+ }
119
+
120
+ //fdDwCurrent
121
+ let fdDwCurrent = get(opt, 'fdDwCurrent')
122
+ if (!isestr(fdDwCurrent)) {
123
+ fdDwCurrent = `./_dwCurrent`
124
+ }
125
+ if (!fsIsFolder(fdDwCurrent)) {
126
+ fsCreateFolder(fdDwCurrent)
127
+ }
128
+
129
+ //fdResult
130
+ let fdResult = get(opt, 'fdResult')
131
+ if (!isestr(fdResult)) {
132
+ fdResult = './_result'
133
+ }
134
+ if (!fsIsFolder(fdResult)) {
135
+ fsCreateFolder(fdResult)
136
+ }
137
+
138
+ //fdTaskCpSrc
139
+ let fdTaskCpSrc = get(opt, 'fdTaskCpSrc')
140
+ if (!isestr(fdTaskCpSrc)) {
141
+ fdTaskCpSrc = './_taskCpSrc'
142
+ }
143
+ if (!fsIsFolder(fdTaskCpSrc)) {
144
+ fsCreateFolder(fdTaskCpSrc)
145
+ }
146
+
147
+ //funDownloadEqs
148
+ let funDownloadEqs = get(opt, 'funDownloadEqs')
149
+
150
+ //funDownload
151
+ let funDownload = get(opt, 'funDownload')
152
+
153
+ //funGetCurrent
154
+ let funGetCurrent = get(opt, 'funGetCurrent')
155
+
156
+ //funAdd
157
+ let funAdd = get(opt, 'funAdd')
158
+
159
+ //funModify
160
+ let funModify = get(opt, 'funModify')
161
+
162
+ //funRemove
163
+ let funRemove = get(opt, 'funRemove')
164
+
165
+ //treeFilesAndGetHashs
166
+ let treeFilesAndGetHashs = (fd) => {
167
+
168
+ //vfps
169
+ let vfps = fsTreeFolder(fd, 1)
170
+ // console.log('vfps', vfps)
171
+
172
+ //ltdtHash
173
+ let ltdtHash = []
174
+ each(vfps, (v) => {
175
+
176
+ let j = fs.readFileSync(v.path, 'utf8')
177
+ let o = JSON.parse(j)
178
+
179
+ ltdtHash.push(o)
180
+
181
+ })
182
+
183
+ return ltdtHash
184
+ }
185
+
186
+ //funDownloadDef
187
+ let funDownloadDef = async() => {
188
+
189
+ //eqs
190
+ let eqs = []
191
+ if (isfun(funDownloadEqs)) {
192
+ eqs = funDownloadEqs()
193
+ if (ispm(eqs)) {
194
+ eqs = await eqs
195
+ }
196
+ }
197
+ else {
198
+ eqs = await downloadEqs(token)
199
+ // console.log('eqs', eqs, size(eqs))
200
+ // eqs = [eqs[0], eqs[1]]
201
+ // fs.writeFileSync('./temp.json', JSON.stringify(eqs, null, 2), 'utf8')
202
+ }
203
+
204
+ //reverse
205
+ eqs = reverse(eqs)
206
+
207
+ //清空fdDwAttime
208
+ fsCleanFolder(fdDwAttime)
209
+
210
+ //複製已下載供比對hash用數據fdDwCurrent至fdDwAttime
211
+ fsCopyFolder(fdDwCurrent, fdDwAttime)
212
+
213
+ //ltdtHashOld, 數據來源為fdDwCurrent, 故為舊hash數據清單
214
+ let ltdtHashOld = treeFilesAndGetHashs(fdDwAttime)
215
+
216
+ //kpHash, 基於舊hash數據建構字典物件
217
+ let kpHash = {}
218
+ each(ltdtHashOld, (v) => {
219
+ kpHash[v.id] = v
220
+ })
221
+
222
+ //逐筆偵測與更新
223
+ await pmSeries(eqs, async(v) => {
224
+
225
+ //先儲存解析後數據至存放完整數據資料夾fdDwStorage
226
+ let fp = `${fdDwStorage}/${v.id}.json`
227
+ fs.writeFileSync(fp, JSON.stringify(v), 'utf8')
228
+
229
+ //計算檔案hash值, 為新hash
230
+ let hashNew = await fsGetFileXxHash(fp)
231
+
232
+ //check
233
+ if (haskey(kpHash, v.id)) {
234
+ //為已下載過之地震數據
235
+
236
+ //舊hash
237
+ let hashOld = kpHash[v.id].hash
238
+
239
+ //check
240
+ if (hashNew !== hashOld) {
241
+
242
+ //update
243
+ kpHash[v.id].hash = hashNew
244
+
245
+ //儲存更新後之新地震hash數據檔案
246
+ let fp = `${fdDwAttime}/${v.id}.json`
247
+ fs.writeFileSync(fp, JSON.stringify(kpHash[v.id]), 'utf8')
248
+
249
+ }
250
+ else {
251
+ //不用更新hash檔案
252
+ }
253
+
254
+ }
255
+ else {
256
+ //為新增之地震數據
257
+
258
+ //add
259
+ kpHash[v.id] = {
260
+ id: v.id,
261
+ hash: hashNew,
262
+ }
263
+
264
+ //儲存新地震hash數據檔案
265
+ let fp = `${fdDwAttime}/${v.id}.json`
266
+ fs.writeFileSync(fp, JSON.stringify(kpHash[v.id]), 'utf8')
267
+
268
+ }
269
+
270
+ })
271
+
272
+ //ltdtHashNew
273
+ let ltdtHashNew = values(kpHash)
274
+
275
+ return ltdtHashNew
276
+ }
277
+ if (!isfun(funDownload)) {
278
+ funDownload = funDownloadDef
279
+ }
280
+
281
+ //funGetCurrentDef
282
+ let funGetCurrentDef = async() => {
283
+
284
+ //vfps
285
+ let vfps = fsTreeFolder(fdDwCurrent, 1)
286
+ // console.log('vfps', vfps)
287
+
288
+ //ltdtHashOld
289
+ let ltdtHashOld = []
290
+ each(vfps, (v) => {
291
+
292
+ let j = fs.readFileSync(v.path, 'utf8')
293
+ let eq = JSON.parse(j)
294
+
295
+ ltdtHashOld.push(eq)
296
+
297
+ })
298
+
299
+ return ltdtHashOld
300
+ }
301
+ if (!isfun(funGetCurrent)) {
302
+ funGetCurrent = funGetCurrentDef
303
+ }
304
+
305
+ //funRemoveDef
306
+ let funRemoveDef = async(v) => {
307
+
308
+ let fd = `${fdResult}/${v.id}`
309
+
310
+ if (fsIsFolder(fd)) {
311
+ fsDeleteFolder(fd)
312
+ }
313
+
314
+ }
315
+ if (!isfun(funRemove)) {
316
+ funRemove = funRemoveDef
317
+ }
318
+
319
+ //funAddDef
320
+ let funAddDef = async(v) => {
321
+
322
+ let fd = `${fdResult}/${v.id}`
323
+
324
+ if (fsIsFolder(fd)) {
325
+ fsCleanFolder(fd)
326
+ }
327
+
328
+ let fpStorage = `${fdDwStorage}/${v.id}.json`
329
+ let fpResult = `${fd}/${v.id}.json`
330
+ fsCopyFile(fpStorage, fpResult)
331
+
332
+ }
333
+ if (!isfun(funAdd)) {
334
+ funAdd = funAddDef
335
+ }
336
+
337
+ //funModifyDef
338
+ let funModifyDef = async(v) => {
339
+
340
+ let fd = `${fdResult}/${v.id}`
341
+
342
+ if (fsIsFolder(fd)) {
343
+ fsCleanFolder(fd)
344
+ }
345
+
346
+ let fpStorage = `${fdDwStorage}/${v.id}.json`
347
+ let fpResult = `${fd}/${v.id}.json`
348
+ fsCopyFile(fpStorage, fpResult)
349
+
350
+ }
351
+ if (!isfun(funModify)) {
352
+ funModify = funModifyDef
353
+ }
354
+
355
+ //WDwdataBuilder
356
+ let optBdr = {
357
+ fdDwAttime,
358
+ fdDwCurrent,
359
+ fdResult,
360
+ fdTaskCpSrc,
361
+ funDownload,
362
+ funGetCurrent,
363
+ funRemove,
364
+ funAdd,
365
+ funModify,
366
+ }
367
+ let ev = await WDwdataBuilder(optBdr)
368
+
369
+ return ev
370
+ }
371
+
372
+
373
+ export default WDwdataTweqod