qtools-library-dot-d 1.0.8 → 1.0.9

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 (74) hide show
  1. package/README.md +1 -0
  2. package/libDotD_Working_Example/README.md +234 -0
  3. package/libDotD_Working_Example/demoModules_DotD/demo1.js +46 -0
  4. package/libDotD_Working_Example/demoModules_DotD/demo2.js +48 -0
  5. package/libDotD_Working_Example/index.js +133 -0
  6. package/libDotD_Working_Example/node_modules/.package-lock.json +29 -0
  7. package/libDotD_Working_Example/node_modules/qtools-asynchronous-pipe-plus/README.md +213 -0
  8. package/libDotD_Working_Example/node_modules/qtools-asynchronous-pipe-plus/package.json +20 -0
  9. package/libDotD_Working_Example/node_modules/qtools-asynchronous-pipe-plus/qtools-asynchronous-pipe-plus.js +278 -0
  10. package/libDotD_Working_Example/node_modules/qtools-asynchronous-pipe-plus/test.js +79 -0
  11. package/libDotD_Working_Example/node_modules/qtools-functional-library/README.md +110 -0
  12. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-clone/package.json +11 -0
  13. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-clone/qtools-clone.js +103 -0
  14. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-clone/test.js +78 -0
  15. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-get-by-property/package.json +11 -0
  16. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-get-by-property/qtools-get-by-property.js +73 -0
  17. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-get-by-property/test.js +129 -0
  18. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-includes-regex/package.json +11 -0
  19. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-includes-regex/qtools-includes-regex.js +54 -0
  20. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-includes-regex/test.js +76 -0
  21. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-log-output/package.json +11 -0
  22. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-log-output/qtools-log-output.js +114 -0
  23. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-log-output/test.js +130 -0
  24. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-map-properties/package.json +11 -0
  25. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-map-properties/qtools-map-properties.js +99 -0
  26. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-map-properties/test.js +118 -0
  27. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-merge/package.json +11 -0
  28. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-merge/qtools-merge.js +147 -0
  29. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-merge/test.js +214 -0
  30. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-new-method-template/package.json +11 -0
  31. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-new-method-template/qtools-new-method-template.js +70 -0
  32. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-new-method-template/test.js +66 -0
  33. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-iterator/package.json +11 -0
  34. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-iterator/qtools-number-iterator.js +137 -0
  35. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-iterator/test.js +68 -0
  36. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-keys-to-array/package.json +11 -0
  37. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-keys-to-array/qtools-number-keys-to-array.js +131 -0
  38. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-keys-to-array/test.js +181 -0
  39. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-object-sure-path/package.json +11 -0
  40. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-object-sure-path/qtools-object-sure-path.js +204 -0
  41. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-object-sure-path/test.js +345 -0
  42. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pass-through/package.json +11 -0
  43. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pass-through/qtools-pass-through.js +58 -0
  44. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pass-through/test.js +66 -0
  45. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pop/package.json +11 -0
  46. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pop/qtools-pop.js +175 -0
  47. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pop/test.js +118 -0
  48. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-print-debug/package.json +11 -0
  49. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-print-debug/qtools-print-debug.js +352 -0
  50. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-print-debug/test.js +77 -0
  51. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-select-properties/package.json +11 -0
  52. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-select-properties/qtools-select-properties.js +132 -0
  53. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-select-properties/test.js +156 -0
  54. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-template-replace/README.md +3 -0
  55. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-template-replace/package.json +11 -0
  56. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-template-replace/qtools-template-replace.js +106 -0
  57. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-template-replace/test.js +168 -0
  58. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-key-value-array/package.json +11 -0
  59. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-key-value-array/qtools-to-key-value-array.js +83 -0
  60. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-key-value-array/test.js +68 -0
  61. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-string/package.json +11 -0
  62. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-string/qtools-to-string.js +84 -0
  63. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-string/test.js +63 -0
  64. package/libDotD_Working_Example/node_modules/qtools-functional-library/package.json +37 -0
  65. package/libDotD_Working_Example/node_modules/qtools-functional-library/qtFunctionalDemo.js +297 -0
  66. package/libDotD_Working_Example/node_modules/qtools-functional-library/qtools-functional-library.js +271 -0
  67. package/libDotD_Working_Example/node_modules/qtools-functional-library/test.js +47 -0
  68. package/libDotD_Working_Example/node_modules/qtools-library-dot-d/README.md +208 -0
  69. package/libDotD_Working_Example/node_modules/qtools-library-dot-d/package.json +15 -0
  70. package/libDotD_Working_Example/node_modules/qtools-library-dot-d/qtools-library-dot-d.js +239 -0
  71. package/libDotD_Working_Example/package-lock.json +37 -0
  72. package/libDotD_Working_Example/package.json +23 -0
  73. package/package.json +1 -1
  74. package/qtools-library-dot-d.js +1 -1
@@ -0,0 +1,130 @@
1
+ 'use strict';
2
+
3
+ //START OF moduleFunction() ============================================================
4
+
5
+ const moduleFunction = function(args) {
6
+ //this module is initialized with parameters spec'd in the main function module
7
+
8
+ const completeStepActual = ({
9
+ verbose = false,
10
+ logErrors = false,
11
+ moduleName
12
+ }) => (methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) => {
13
+ const thisStepPass = thisStepEvalFunction(thisStepResult);
14
+
15
+ if (logErrors && !thisStepPass) {
16
+ console.log(`FAIL TEST: ${thisStepMessage} in ...${moduleName}`);
17
+ }
18
+ if (verbose) {
19
+ console.log(`Result for: ${methodName} (${thisStepPass?'PASS':'FAIL'}):`);
20
+ console.dir(thisStepResult);
21
+ console.log('\n\n');
22
+ }
23
+
24
+ return passingTests && thisStepPass;
25
+ };
26
+
27
+ const completeStep = completeStepActual(args);
28
+
29
+ let passingTests = true;
30
+
31
+ let thisStepMessage;
32
+ let thisStepResult;
33
+ let thisStepEvalFunction;
34
+ let methodName;
35
+
36
+ //TESTS ============================================================
37
+
38
+
39
+ const testObject={
40
+ substitution1:'with object substitution',
41
+ nested:{
42
+ element:'replaced from a nested element'
43
+ }
44
+ }
45
+
46
+ const replaceObject={
47
+ fromReplaceObj:"additional replacement object substitution"
48
+ }
49
+
50
+
51
+ //TEST ITEM ------------------------------------------------------
52
+ methodName = 'qtLog';
53
+ thisStepMessage = 'object.qtLog() message test';
54
+ thisStepResult = testObject[methodName](thisStepMessage, {noSuffix:true, destination:'returnString'});
55
+ thisStepEvalFunction = item => item==thisStepMessage;
56
+ passingTests =
57
+ completeStep(
58
+ methodName,
59
+ thisStepMessage,
60
+ thisStepResult,
61
+ thisStepEvalFunction
62
+ ) && passingTests;
63
+
64
+
65
+ methodName = 'qtLog';
66
+ thisStepMessage = 'object.qtLog() message test -><!substitution1!><-';
67
+ thisStepResult = testObject[methodName](thisStepMessage, {noSuffix:true, destination:'returnString'});
68
+ thisStepEvalFunction = item => item=='object.qtLog() message test ->with object substitution<-';
69
+ passingTests =
70
+ completeStep(
71
+ methodName,
72
+ thisStepMessage,
73
+ thisStepResult,
74
+ thisStepEvalFunction
75
+ ) && passingTests;
76
+
77
+
78
+ methodName = 'qtLog';
79
+ thisStepMessage = 'object.qtLog() message test -><!substitution1!><- and -><!fromReplaceObj!><-';
80
+ thisStepResult = testObject[methodName](thisStepMessage, {noSuffix:true, destination:'returnString', substitutions:replaceObject});
81
+ thisStepEvalFunction = item => item=='object.qtLog() message test ->with object substitution<- and ->additional replacement object substitution<-';
82
+ passingTests =
83
+ completeStep(
84
+ methodName,
85
+ thisStepMessage,
86
+ thisStepResult,
87
+ thisStepEvalFunction
88
+ ) && passingTests;
89
+
90
+
91
+ methodName = 'qtLog';
92
+ thisStepMessage = 'object.qtLog() message test -><!nested.element!><-';
93
+ thisStepResult = testObject[methodName](thisStepMessage, {noSuffix:true, destination:'returnString', substitutions:testObject});
94
+ thisStepEvalFunction = item => item=='object.qtLog() message test ->replaced from a nested element<-';
95
+ passingTests =
96
+ completeStep(
97
+ methodName,
98
+ thisStepMessage,
99
+ thisStepResult,
100
+ thisStepEvalFunction
101
+ ) && passingTests;
102
+
103
+ const qt=require('../../qtools-functional-library');
104
+
105
+ methodName = 'log';
106
+ thisStepMessage = 'qt.log() message test -><!substitution1!><-';
107
+ thisStepResult = qt[methodName](thisStepMessage, {noSuffix:true, destination:'returnString', substitutions:testObject});
108
+ thisStepEvalFunction = item => item=='qt.log() message test ->with object substitution<-';
109
+ passingTests =
110
+ completeStep(
111
+ methodName,
112
+ thisStepMessage,
113
+ thisStepResult,
114
+ thisStepEvalFunction
115
+ ) && passingTests;
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+ return passingTests;
124
+ };
125
+
126
+ //END OF moduleFunction() ============================================================
127
+
128
+ module.exports = moduleFunction;
129
+ //module.exports = new moduleFunction();
130
+
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "qtools-map-properties",
3
+ "version": "1.0.0",
4
+ "description": " Transform and add properties to a javascript object or array of objects",
5
+ "main": "qtools-map-properties.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "TQ White II",
10
+ "license": "ISC"
11
+ }
@@ -0,0 +1,99 @@
1
+ 'use strict';
2
+ //START OF moduleFunction() ============================================================
3
+ var moduleFunction = function(args = {}) {
4
+ const { commonFunctions } = args;
5
+
6
+ const addToPrototypeActual = functionObject => () =>
7
+ commonFunctions.universalAddToPrototype(commonFunctions, functionObject);
8
+
9
+
10
+
11
+ //first method definition function ==========================
12
+ const firstMethodFunction = commonFunctions => {
13
+ const methodName = 'qtMapProperties';
14
+ const description = `operand.qtMapProperties() transforms and adds properties to a javascript object or array of objects`;
15
+ const supportedTypeList = [Array, Object];
16
+
17
+ const method = () =>
18
+ function(mappings = {}, options = {}) {
19
+ const mappingFunction = item => {
20
+ const outObj = item.qtClone();
21
+ const originalThis = item.qtClone();
22
+
23
+ // mappingElementFunction=(item, name, entire)=>{}; //note: synthetic elements have item==undefined
24
+
25
+ Object.keys(mappings).forEach(name => {
26
+ if (typeof mappings[name] == 'function') {
27
+ outObj[name] = mappings[name](
28
+ originalThis[name],
29
+ name,
30
+ originalThis
31
+ );
32
+ } else {
33
+ outObj[name] = mappings[name];
34
+ }
35
+ });
36
+ return outObj;
37
+ };
38
+
39
+
40
+
41
+ if (this instanceof Array) {
42
+ return this.map(item => mappingFunction(item));
43
+ } else {
44
+ return mappingFunction(this);
45
+ }
46
+
47
+ };
48
+
49
+ const test = args => {
50
+ return require('./test.js')({
51
+ ...args,
52
+ ...{
53
+ moduleName: module.id.replace(module.path, '')
54
+ }
55
+ });
56
+ };
57
+
58
+ return {
59
+ methodName,
60
+ description,
61
+ supportedTypeList,
62
+ method,
63
+ test
64
+ };
65
+ };
66
+
67
+
68
+ const functionObject = new Map(); // prettier-ignore
69
+ const addFunction = definition => {
70
+ const {
71
+ methodName,
72
+ description,
73
+ supportedTypeList,
74
+ method,
75
+ test
76
+ } = definition;
77
+ functionObject.set(methodName, {
78
+ description,
79
+ supportedTypeList,
80
+ method,
81
+ test: args => {
82
+ return require('./test.js')({
83
+ ...args,
84
+ ...{
85
+ moduleName: module.id.replace(module.path, '')
86
+ }
87
+ });
88
+ }
89
+ });
90
+ };
91
+
92
+ addFunction(firstMethodFunction());
93
+
94
+ this.addToPrototype = addToPrototypeActual(functionObject);
95
+
96
+ };
97
+ //END OF moduleFunction() ============================================================
98
+ module.exports = moduleFunction;
99
+ //module.exports = new moduleFunction();
@@ -0,0 +1,118 @@
1
+ 'use strict';
2
+
3
+ //START OF moduleFunction() ============================================================
4
+
5
+ const moduleFunction = function(args) {
6
+ //this module is initialized with parameters spec'd in the main function module
7
+
8
+ const completeStepActual = ({verbose=false, logErrors=false, moduleName}) => (
9
+ methodName,
10
+ thisStepMessage,
11
+ thisStepResult,
12
+ thisStepEvalFunction
13
+ ) => {
14
+
15
+ const thisStepPass = thisStepEvalFunction(thisStepResult);
16
+
17
+ if (logErrors && !thisStepPass) {
18
+ console.log(`FAIL TEST: ${thisStepMessage} in ...${moduleName}`);
19
+ }
20
+ if (verbose) {
21
+ console.log(`Result for: ${methodName} (${thisStepPass?'PASS':'FAIL'}):`);
22
+ console.dir(thisStepResult);
23
+ console.log('\n\n');
24
+ }
25
+
26
+ return passingTests && thisStepPass;
27
+ };
28
+
29
+ const completeStep = completeStepActual(args);
30
+
31
+ let passingTests = true;
32
+
33
+ let thisStepMessage;
34
+ let thisStepResult;
35
+ let thisStepEvalFunction;
36
+ let methodName;
37
+
38
+ //TESTS ============================================================
39
+
40
+
41
+
42
+ const testObject={
43
+ one: 1,
44
+ two: 2
45
+ }
46
+
47
+ const testArray=[
48
+ {
49
+ alpha: 11,
50
+ beta: 12
51
+ },{
52
+ alpha: 21,
53
+ beta: 22
54
+ }
55
+ ];
56
+
57
+ const testOneArgument={
58
+ one: (item, name, entire)=>item*1000
59
+ }
60
+ const testTwoArgument={
61
+ one: (item, name, entire)=>item*1000,
62
+ addedValue:(item, name, entire)=>`${name} says, item:${item} becomes ${Object.keys(entire).join(', ')}`
63
+ }
64
+ const testThreeArgument={
65
+ alpha: (item, name, entire)=>item*1000,
66
+ addedValue:(item, name, entire)=>`${name} says, item:${item} becomes ${Object.keys(entire).join(', ')}`
67
+ }
68
+ // map one object
69
+ // map one with added property
70
+ // map array
71
+
72
+
73
+
74
+ //TEST ITEM ------------------------------------------------------
75
+ methodName='qtMapProperties'
76
+ thisStepMessage = "did not get map one object ";
77
+ thisStepResult = testObject[methodName](testOneArgument);
78
+ thisStepEvalFunction = item => (item.one==1000 && item.two==2);
79
+ passingTests =
80
+ completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
81
+ passingTests;
82
+
83
+
84
+ //TEST ITEM ------------------------------------------------------
85
+ methodName='qtMapProperties'
86
+ thisStepMessage = "did not map one with added property";
87
+ thisStepResult = testObject[methodName](testTwoArgument);
88
+ thisStepEvalFunction = item => (item.one==1000 && item.two==2 && item.addedValue=='addedValue says, item:undefined becomes one, two');
89
+ passingTests =
90
+ completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
91
+ passingTests;
92
+
93
+
94
+ //TEST ITEM ------------------------------------------------------
95
+ methodName='qtMapProperties'
96
+ thisStepMessage = "did not map array woth added property";
97
+ thisStepResult = testArray[methodName](testThreeArgument);
98
+ thisStepEvalFunction = item => (
99
+ item[0].alpha==11000 &&
100
+ item[0].beta==12 &&
101
+ item[0].addedValue=='addedValue says, item:undefined becomes alpha, beta' &&
102
+ item[1].alpha==21000 &&
103
+ item[1].beta==22 &&
104
+ item[1].addedValue=='addedValue says, item:undefined becomes alpha, beta'
105
+ );
106
+ passingTests =
107
+ completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
108
+ passingTests;
109
+
110
+
111
+ return passingTests;
112
+ };
113
+
114
+ //END OF moduleFunction() ============================================================
115
+
116
+ module.exports = moduleFunction;
117
+ //module.exports = new moduleFunction();
118
+
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "qtools-merge",
3
+ "version": "1.0.0",
4
+ "description": "Merge objects deeply",
5
+ "main": "qtools-merge.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "TQ White II",
10
+ "license": "ISC"
11
+ }
@@ -0,0 +1,147 @@
1
+ 'use strict';
2
+ //START OF moduleFunction() ============================================================
3
+ var moduleFunction = function(args = {}) {
4
+ const { commonFunctions } = args;
5
+
6
+ const addToPrototypeActual = functionObject => () =>
7
+ commonFunctions.universalAddToPrototype(commonFunctions, functionObject);
8
+
9
+ const baseMerge = (receivingObject, sendingObject, args = {}) => {
10
+
11
+
12
+ const { mergeNonExistent = true } = args;
13
+
14
+
15
+
16
+ if (
17
+ ['string', 'number', 'boolean', 'function', 'date'].includes(
18
+ typeof sendingObject
19
+ )
20
+ ) {
21
+ receivingObject = sendingObject;
22
+ return receivingObject;
23
+ }
24
+
25
+
26
+
27
+ for (var i in sendingObject) {
28
+ if (!sendingObject.hasOwnProperty(i)) {
29
+ continue;
30
+ }
31
+
32
+ var element = sendingObject[i];
33
+
34
+ if (
35
+ ['string', 'number', 'boolean', 'function', 'date'].includes(
36
+ typeof element
37
+ ) ||
38
+ ['string', 'number', 'boolean', 'function', 'date'].includes(
39
+ typeof receivingObject[i]
40
+ )
41
+ ) {
42
+ receivingObject[i] = element;
43
+ continue;
44
+ }
45
+
46
+ if (
47
+ mergeNonExistent &&
48
+ (element == null || typeof element == 'undefined' || element === '')
49
+ ) {
50
+ receivingObject[i] = element;
51
+ continue;
52
+ }
53
+
54
+ if (element instanceof Array) {
55
+ if (typeof receivingObject[i] == 'undefined') {
56
+ receivingObject[i] = [];
57
+ }
58
+
59
+ element.forEach((item, inx) => {
60
+ if (
61
+ receivingObject.qtGetSurePath(`${i}.${inx}`) &&
62
+ element.qtGetSurePath(`${inx}`)
63
+ ) {
64
+
65
+ receivingObject[i][inx] = baseMerge(
66
+ receivingObject[i][inx],
67
+ element[inx],
68
+ args
69
+ );
70
+ } else if (element.qtGetSurePath(`${inx}`)) {
71
+ receivingObject[i][inx] = element[inx];
72
+ }
73
+
74
+ });
75
+
76
+ continue;
77
+ }
78
+
79
+ if (element instanceof Object) {
80
+ if (typeof receivingObject[i] == 'undefined') {
81
+ receivingObject[i] = {};
82
+ }
83
+
84
+ receivingObject[i] = baseMerge(receivingObject[i], element, args);
85
+ continue;
86
+ }
87
+ }
88
+
89
+ return receivingObject;
90
+ };
91
+
92
+ //first method definition function ==========================
93
+ const firstMethodFunction = commonFunctions => {
94
+ const functionObject = new Map(); // prettier-ignore
95
+
96
+ const methodName = 'qtMerge';
97
+ const description = `Deep merge of two objects. Clones by default. receivingObject.qtMerge(sendingObject, {mutateObjects:false, mergeNonExistent:true}). DOESN'T YET WORK FOR MAPS OR SETS.`;
98
+ const supportedTypeList = [Object];
99
+
100
+ const method = () =>
101
+ function(sendingObject, args = {}) {
102
+ //if one of the supportedTypeList elements is Object, basically all data types will have this method and type checking is important.
103
+ if (!commonFunctions.isSupportedType(this, supportedTypeList)) {
104
+ // prettier-ignore
105
+ throw new Error(
106
+ `${methodName}(): unsupported data type: '${commonFunctions.toType(this)}' (${methodName} supports ${supportedTypeList.map(item=>item.toString().replace(/.*function (.*?)\(\).*/, '$1')).join(', ')})`
107
+ );
108
+ }
109
+
110
+ const { mutateObjects = false } = args;
111
+
112
+ let receivingObject = this;
113
+
114
+ if (!mutateObjects) {
115
+ receivingObject = this.qtClone();
116
+ sendingObject = sendingObject.qtClone();
117
+ }
118
+
119
+ const outObj = baseMerge(receivingObject, sendingObject, args);
120
+
121
+ return outObj;
122
+ };
123
+
124
+ functionObject.set(methodName, {
125
+ description,
126
+ supportedTypeList,
127
+ method,
128
+ test: args => {
129
+ return require('./test.js')({
130
+ ...args,
131
+ ...{
132
+ moduleName: module.id.replace(module.path, '')
133
+ }
134
+ });
135
+ }
136
+ });
137
+
138
+ return functionObject;
139
+ };
140
+ this.addToPrototype = addToPrototypeActual(
141
+ firstMethodFunction(commonFunctions)
142
+ );
143
+
144
+ };
145
+ //END OF moduleFunction() ============================================================
146
+ module.exports = moduleFunction;
147
+ //module.exports = new moduleFunction();