file-obj-queue 2.0.5 → 3.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 (50) hide show
  1. package/.github/workflows/{github-actions-demo.yml → github-actions.yml} +1 -1
  2. package/.github/workflows/node.js.yml +1 -0
  3. package/LICENSE +1 -1
  4. package/README.md +132 -7
  5. package/app.js +155 -40
  6. package/lib/appenders/all.js +17 -0
  7. package/lib/appenders/base.js +189 -0
  8. package/lib/appenders/bottom_one.js +17 -0
  9. package/lib/appenders/func_all.js +17 -0
  10. package/lib/appenders/name.js +17 -0
  11. package/lib/appenders/status.js +17 -0
  12. package/lib/appenders/sync.js +17 -0
  13. package/lib/appenders/sync_all.js +17 -0
  14. package/lib/appenders/top_one.js +17 -0
  15. package/lib/appenders/version.js +17 -0
  16. package/package.json +24 -3
  17. package/test/app.js +5 -1
  18. package/test/package.js +25 -3
  19. package/tests/all.js +85 -0
  20. package/tests/appenders/all.js +1 -1
  21. package/tests/appenders/base.js +1 -1
  22. package/tests/appenders/bottom_one.js +1 -1
  23. package/tests/appenders/func_all.js +1 -1
  24. package/tests/appenders/sync.js +1 -1
  25. package/tests/appenders/sync_all.js +1 -1
  26. package/tests/appenders/top_one.js +1 -1
  27. package/tests/appenders/version.js +1 -1
  28. package/tests/bottom_one.js +86 -0
  29. package/tests/files.js +50 -32
  30. package/tests/func_all.js +94 -0
  31. package/tests/json_all.js +107 -0
  32. package/tests/json_bottom_one.js +108 -0
  33. package/tests/json_func_all.js +109 -0
  34. package/tests/json_name_matching.js +109 -0
  35. package/tests/json_name_non_matching.js +109 -0
  36. package/tests/json_status_matching.js +110 -0
  37. package/tests/json_status_non_matching.js +110 -0
  38. package/tests/json_top_one.js +108 -0
  39. package/tests/json_version_matching.js +110 -0
  40. package/tests/json_version_non_matching.js +110 -0
  41. package/tests/name_matching.js +90 -0
  42. package/tests/name_non_matching.js +90 -0
  43. package/tests/status_matching.js +90 -0
  44. package/tests/status_non_matching.js +90 -0
  45. package/tests/top_one.js +85 -0
  46. package/tests/version_matching.js +90 -0
  47. package/tests/version_non_matching.js +90 -0
  48. package/base_queue/app.js +0 -146
  49. package/base_queue/appenders/base.js +0 -77
  50. package/base_queue/appenders/json_all.js +0 -70
@@ -1,70 +0,0 @@
1
- /*
2
- * @author Jim Manton: jrman@risebroadband.net
3
- * @since 2022-12-11
4
- * all.ts
5
- */
6
-
7
- var base = require('./base.js')
8
-
9
- exports = module.exports = class json_all extends base {
10
- constructor(props) {
11
- super(props)
12
- var t = this, fname = 'json_all.constructor'
13
- try {
14
- t.aname = 'json_all'
15
- t.main_process_objects = []
16
-
17
- if (t.base_name_appender != t.aname)
18
- throw new Error(`(${t.base_name_appender}) does not equal the appender name (${t.aname}))`)
19
-
20
- t.parent.logMsg(`${fname}`.debug)
21
-
22
- t.init = t.init.bind(t)
23
- t.process = t.process.bind(t)
24
-
25
- return t
26
- } catch (e) {
27
- t.parent.base_reject(`${fname} error: ${e.message})`)
28
- }
29
- }
30
-
31
- init (props = {}) {
32
- var t = this, fname = `json_all.init`, gotp, gdtpa, obj
33
- try {
34
- t.parent.logMsg(`${fname}`.debug)
35
-
36
- if (typeof t.get_objects_to_process()[0] == "undefined")
37
- throw new Error(`get_objects_to_process[0] has no data`)
38
-
39
- t.get_data_to_process_array().map((dat, i)=>{
40
- dat.props.log = t.parent.logMsg
41
- obj = t.get_objects_to_process()[0]
42
- t.main_process_objects.push(new obj(dat.props))
43
- })
44
-
45
- super.init(props)
46
- return t
47
- } catch (e) {
48
- t.parent.base_reject(`${fname} error: ${e.message})`)
49
- }
50
- }
51
-
52
- process (props = {}) {
53
- var t = this, fname = `json_all.process`
54
- try {
55
- t.parent.logMsg(`${fname} length(${t.main_process_objects.length})`.debug)
56
-
57
- t.main_process_objects.map((obj, i)=>{
58
- obj.process((res)=>{
59
- // t.parent.logMsg(`${fname}${JSON.stringify(res)})`.debug)
60
- t.results_array.push(res)
61
- })
62
- })
63
-
64
- super.process(props)
65
- return t
66
- } catch (e) {
67
- t.parent.base_reject(`${fname} error: ${e.message})`)
68
- }
69
- }
70
- }