qtools-library-dot-d 1.0.12 → 1.0.13

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/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/package.json +2 -2
  4. package/libDotD_Working_Example/README.md +0 -234
  5. package/libDotD_Working_Example/demoModules_DotD/demo1.js +0 -46
  6. package/libDotD_Working_Example/demoModules_DotD/demo2.js +0 -48
  7. package/libDotD_Working_Example/index.js +0 -133
  8. package/libDotD_Working_Example/node_modules/.package-lock.json +0 -29
  9. package/libDotD_Working_Example/node_modules/qtools-asynchronous-pipe-plus/README.md +0 -213
  10. package/libDotD_Working_Example/node_modules/qtools-asynchronous-pipe-plus/package.json +0 -20
  11. package/libDotD_Working_Example/node_modules/qtools-asynchronous-pipe-plus/qtools-asynchronous-pipe-plus.js +0 -278
  12. package/libDotD_Working_Example/node_modules/qtools-asynchronous-pipe-plus/test.js +0 -79
  13. package/libDotD_Working_Example/node_modules/qtools-functional-library/README.md +0 -110
  14. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-clone/package.json +0 -11
  15. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-clone/qtools-clone.js +0 -103
  16. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-clone/test.js +0 -78
  17. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-get-by-property/package.json +0 -11
  18. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-get-by-property/qtools-get-by-property.js +0 -73
  19. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-get-by-property/test.js +0 -129
  20. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-includes-regex/package.json +0 -11
  21. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-includes-regex/qtools-includes-regex.js +0 -54
  22. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-includes-regex/test.js +0 -76
  23. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-log-output/package.json +0 -11
  24. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-log-output/qtools-log-output.js +0 -114
  25. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-log-output/test.js +0 -130
  26. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-map-properties/package.json +0 -11
  27. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-map-properties/qtools-map-properties.js +0 -99
  28. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-map-properties/test.js +0 -118
  29. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-merge/package.json +0 -11
  30. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-merge/qtools-merge.js +0 -147
  31. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-merge/test.js +0 -214
  32. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-new-method-template/package.json +0 -11
  33. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-new-method-template/qtools-new-method-template.js +0 -70
  34. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-new-method-template/test.js +0 -66
  35. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-iterator/package.json +0 -11
  36. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-iterator/qtools-number-iterator.js +0 -137
  37. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-iterator/test.js +0 -68
  38. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-keys-to-array/package.json +0 -11
  39. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-keys-to-array/qtools-number-keys-to-array.js +0 -131
  40. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-number-keys-to-array/test.js +0 -181
  41. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-object-sure-path/package.json +0 -11
  42. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-object-sure-path/qtools-object-sure-path.js +0 -204
  43. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-object-sure-path/test.js +0 -345
  44. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pass-through/package.json +0 -11
  45. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pass-through/qtools-pass-through.js +0 -58
  46. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pass-through/test.js +0 -66
  47. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pop/package.json +0 -11
  48. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pop/qtools-pop.js +0 -175
  49. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-pop/test.js +0 -118
  50. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-print-debug/package.json +0 -11
  51. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-print-debug/qtools-print-debug.js +0 -352
  52. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-print-debug/test.js +0 -77
  53. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-select-properties/package.json +0 -11
  54. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-select-properties/qtools-select-properties.js +0 -132
  55. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-select-properties/test.js +0 -156
  56. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-template-replace/README.md +0 -3
  57. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-template-replace/package.json +0 -11
  58. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-template-replace/qtools-template-replace.js +0 -106
  59. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-template-replace/test.js +0 -168
  60. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-key-value-array/package.json +0 -11
  61. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-key-value-array/qtools-to-key-value-array.js +0 -83
  62. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-key-value-array/test.js +0 -68
  63. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-string/package.json +0 -11
  64. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-string/qtools-to-string.js +0 -84
  65. package/libDotD_Working_Example/node_modules/qtools-functional-library/lib/qtools-to-string/test.js +0 -63
  66. package/libDotD_Working_Example/node_modules/qtools-functional-library/package.json +0 -37
  67. package/libDotD_Working_Example/node_modules/qtools-functional-library/qtFunctionalDemo.js +0 -297
  68. package/libDotD_Working_Example/node_modules/qtools-functional-library/qtools-functional-library.js +0 -271
  69. package/libDotD_Working_Example/node_modules/qtools-functional-library/test.js +0 -47
  70. package/libDotD_Working_Example/node_modules/qtools-library-dot-d/README.md +0 -208
  71. package/libDotD_Working_Example/node_modules/qtools-library-dot-d/package.json +0 -15
  72. package/libDotD_Working_Example/node_modules/qtools-library-dot-d/qtools-library-dot-d.js +0 -239
  73. package/libDotD_Working_Example/package-lock.json +0 -37
  74. package/libDotD_Working_Example/package.json +0 -23
@@ -1,214 +0,0 @@
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
- thisStepResult.qtDump();
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 testArray = {
43
- animal: 'bird',
44
- eatsWith: 'teeth',
45
- color: 'red',
46
- list:['orig1',2,3, 4],
47
- deep:[
48
- {a:'a'},
49
- {b:{nestedList:['d1','d2','d3']}}
50
- ]
51
- };
52
-
53
- const testArray2 = {
54
- animal: 'fish',
55
- eatsWith: 'snout',
56
- shoeSize:10,
57
- list:['q',void(0),'new3',void(0),'new5'],
58
- deep:[
59
- {c:'creplacement'},
60
- {b:{nestedList:['d1replacement']}}
61
- ],
62
- new_array_not_in_replacement:[
63
- 'newA',
64
- 'newB'
65
- ],
66
- new_object_not_in_original:{
67
- hello:'goodbye',
68
- orange:'black'
69
- }
70
- };
71
-
72
-
73
- const testArray3 = {
74
- animal: 'mastodon',
75
- horns:'pointy'
76
- };
77
-
78
-
79
- const arrayTestA={
80
- a:'b',
81
- b:{'x':10, y:20},
82
- c:{
83
- importantArray:[
84
- {one:1, two:2},
85
- {onex:1, twox:2},
86
- ],
87
- arrayOfBasicTypes:[
88
- 'first',
89
- 'second'
90
-
91
- ]
92
-
93
-
94
- }
95
- };
96
-
97
- const arrayTestB={}
98
- arrayTestB.c={};
99
- arrayTestB.c.importantArray=[];
100
- arrayTestB.c.importantArray[3]={oney:1, twoy:2};
101
-
102
- const arrayTestC={}
103
- arrayTestC.c={};
104
- arrayTestC.c.importantArray=[];
105
- arrayTestC.c.importantArray[1]={twox:22};
106
-
107
- const arrayTestD={
108
- c:{
109
- arrayOfBasicTypes:[]
110
- }
111
- }
112
- arrayTestD.c.arrayOfBasicTypes[0]='replacesFirst';
113
-
114
- const arrayTestE={
115
- a:{replaces:'scalar'},
116
- b:'replacesArray'
117
-
118
- }
119
-
120
-
121
-
122
- //TEST ITEM ------------------------------------------------------
123
- methodName='qtMerge'
124
- thisStepMessage = "Failed to replace base type with complex one or vice versa";
125
- thisStepResult = arrayTestA[methodName](arrayTestE, {mergeNonExistent:true});
126
- thisStepEvalFunction = item =>
127
- item.qtGetSurePath('c.arrayOfBasicTypes[0]')=='replacesFirst' &&
128
- item.qtGetSurePath('c.arrayOfBasicTypes[1]')=='second';
129
- passingTests =
130
- completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
131
- passingTests;
132
-
133
- //TEST ITEM ------------------------------------------------------
134
- methodName='qtMerge'
135
- thisStepMessage = "Didn't merge array correctly";
136
- thisStepResult = arrayTestA[methodName](arrayTestD, {mergeNonExistent:true});
137
- thisStepEvalFunction = item =>
138
- item.qtGetSurePath('c.arrayOfBasicTypes[0]')=='replacesFirst' &&
139
- item.qtGetSurePath('c.arrayOfBasicTypes[1]')=='second';
140
- passingTests =
141
- completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
142
- passingTests;
143
-
144
- //TEST ITEM ------------------------------------------------------
145
- methodName='qtMerge'
146
- thisStepMessage = "Didn't merge basic array element correctly";
147
- thisStepResult = arrayTestA[methodName](arrayTestB, {mergeNonExistent:true});
148
- thisStepEvalFunction = item =>
149
- item.qtGetSurePath('c.importantArray[0].one')==1 &&
150
- item.qtGetSurePath('c.importantArray[1].twox')==2 &&
151
- item.qtGetSurePath('c.importantArray[2]', 'undefined')=='undefined' &&
152
- item.qtGetSurePath('c.importantArray[3].oney')==1;
153
- passingTests =
154
- completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
155
- passingTests;
156
-
157
- //TEST ITEM ------------------------------------------------------
158
- methodName='qtMerge'
159
- thisStepMessage = "Didn't merge object element inside an array correctly";
160
- thisStepResult = arrayTestA[methodName](arrayTestC, {mergeNonExistent:true});
161
- thisStepEvalFunction = item =>
162
- item.qtGetSurePath('c.importantArray[1].onex')==1 &&
163
- item.qtGetSurePath('c.importantArray[1].twox')==22;
164
- passingTests =
165
- completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
166
- passingTests;
167
-
168
- //TEST ITEM ------------------------------------------------------
169
- methodName='qtMerge'
170
- thisStepMessage = "Didn't merge deep replacement property correctly";
171
- thisStepResult = testArray[methodName](testArray2, {mergeNonExistent:true});
172
- thisStepEvalFunction = item => item.qtGetSurePath('deep[1].b.nestedList[0]')=='d1replacement';
173
- passingTests =
174
- completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
175
- passingTests;
176
- //
177
- // //TEST ITEM ------------------------------------------------------
178
- // methodName='qtMerge'
179
- // thisStepMessage = "Didn't merge undefined item correctly";
180
- // thisStepResult = testArray[methodName](testArray2, {mergeNonExistent:true});
181
- // thisStepEvalFunction = item => typeof(item.qtGetSurePath('list[1]'))=='undefined';
182
- // passingTests =
183
- // completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
184
- // passingTests;
185
- //
186
- // //TEST ITEM ------------------------------------------------------
187
- // methodName='qtMerge'
188
- // thisStepMessage = "did not merge nested array element";
189
- // thisStepResult = testArray[methodName](testArray2, {mergeNonExistent:false});
190
- // thisStepEvalFunction = item => item.qtGetSurePath('deep[1].b.nestedList[0]')=='d1replacement';
191
- // passingTests =
192
- // completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
193
- // passingTests;
194
- //
195
- // //TEST ITEM ------------------------------------------------------
196
- // methodName='qtMerge'
197
- // thisStepMessage = "did not merge third object correctly";
198
- // thisStepResult = testArray[methodName](testArray2, {mergeNonExistent:false}).qtMerge(testArray3);
199
- // thisStepEvalFunction = item => item.horns=='pointy' && item.animal=='mastodon' && item.eatsWith=='snout';
200
- // passingTests =
201
- // completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
202
- // passingTests;
203
- //
204
- //
205
-
206
-
207
- return passingTests;
208
- };
209
-
210
- //END OF moduleFunction() ============================================================
211
-
212
- module.exports = moduleFunction;
213
- //module.exports = new moduleFunction();
214
-
@@ -1,11 +0,0 @@
1
- {
2
- "name": "qtools-new-method-template",
3
- "version": "1.0.0",
4
- "description": "Barest bones new qtLib method to start building a real one. DON'T EVER OVERWRITE THIS.",
5
- "main": "qtools-new-method-template.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "TQ White II",
10
- "license": "ISC"
11
- }
@@ -1,70 +0,0 @@
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 functionObject = new Map(); // prettier-ignore
14
-
15
- const methodName = 'qtTemplateMethod';
16
- const description = `placeholder`;
17
- const supportedTypeList = [Array, String, Number];
18
-
19
- const method = () =>
20
- function(arg) {
21
- //if one of the supportedTypeList elements is Object, basically all data types will have this method and type checking is important.
22
- if (!commonFunctions.isSupportedType(this, supportedTypeList)) {
23
- // prettier-ignore
24
- throw new Error(
25
- `${methodName}(): unsupported data type: '${commonFunctions.toType(this)}' (${methodName} supports ${supportedTypeList.map(item=>item.toString().replace(/.*function (.*?)\(\).*/, '$1')).join(', ')})`
26
- );
27
- }
28
-
29
- return this.toString() + ` : ${arg}`;
30
- };
31
-
32
- functionObject.set(methodName, {
33
- description,
34
- supportedTypeList,
35
- method,
36
- test: (args) =>
37
- {
38
- return require('./test.js')({...args, ...{
39
- moduleName: module.id.replace(module.path, '')
40
- }})
41
- }
42
- });
43
-
44
- const placeholder=input=>input+'morePlaceholder';
45
-
46
- functionObject.set('qtTemplateMethod2', {
47
- description: `placeholder`,
48
- supportedTypeList: [String],
49
- method: () => placeholder,
50
- test: args => {
51
- return require('./test.js')({
52
- ...args,
53
- ...{
54
- moduleName: module.id.replace(module.path, '')
55
- }
56
- });
57
- }
58
- });
59
-
60
-
61
- return functionObject;
62
- };
63
- this.addToPrototype = addToPrototypeActual(
64
- firstMethodFunction(commonFunctions)
65
- );
66
-
67
- };
68
- //END OF moduleFunction() ============================================================
69
- module.exports = moduleFunction;
70
- //module.exports = new moduleFunction();
@@ -1,66 +0,0 @@
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
- thisStepResult.qtDump();
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
- const testArray = [
42
- 'allocute',
43
- 'Hello'
44
- ];
45
-
46
-
47
- //TEST ITEM ------------------------------------------------------
48
- methodName='qtTemplateMethod'
49
- thisStepMessage = "not yet implemented";
50
- thisStepResult = testArray[methodName]('SUFFIX');
51
- thisStepEvalFunction = item => item='allocute,Hello : SUFFIX';
52
- passingTests =
53
- completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
54
- passingTests;
55
-
56
-
57
-
58
-
59
- return passingTests;
60
- };
61
-
62
- //END OF moduleFunction() ============================================================
63
-
64
- module.exports = moduleFunction;
65
- //module.exports = new moduleFunction();
66
-
@@ -1,11 +0,0 @@
1
- {
2
- "name": "qtools-number-iterator",
3
- "version": "1.0.0",
4
- "description": "Creates a functional for-loop on the Number prototype",
5
- "main": "qtools-number-iterator.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "TQ White II",
10
- "license": "ISC"
11
- }
@@ -1,137 +0,0 @@
1
- 'use strict';
2
-
3
- //START OF moduleFunction() ============================================================
4
-
5
- var moduleFunction = function(args = {}) {
6
- const { commonFunctions } = args;
7
-
8
- const addToPrototypeActual = functionObject => () =>
9
- commonFunctions.universalAddToPrototype(commonFunctions, functionObject);
10
-
11
-
12
- const setStart = function(startValue) {
13
- if (typeof startValue != 'number') {
14
- throw 'qtNumberIterator.setStart() requires a numeric value';
15
- }
16
-
17
- if (this instanceof IterationThing) {
18
- this.startValue = startValue;
19
- return this;
20
- }
21
- return new IterationThing({
22
- startValue: startValue,
23
- incrementValue: 1,
24
- count: this
25
- });
26
- };
27
-
28
- const setIncrement = function(incrementValue) {
29
- if (typeof incrementValue != 'number') {
30
- throw 'qtNumberIterator.setIncrement() requires a numeric value';
31
- }
32
-
33
- if (this instanceof IterationThing) {
34
- this.incrementValue = incrementValue;
35
- return this;
36
- }
37
- return new IterationThing({
38
- startValue: 0,
39
- incrementValue: 1,
40
- count: this
41
- });
42
- };
43
-
44
- const iterator = function(callback) {
45
- let startValue = 0;
46
- let incrementValue = 1;
47
- let count = this;
48
-
49
- if (this instanceof IterationThing) {
50
- startValue = this.startValue;
51
- count = this.count;
52
- incrementValue = this.incrementValue;
53
- }
54
-
55
- const out = [];
56
- for (let i = 0; i < count; i = i + 1) {
57
- const currentValue = startValue + i * incrementValue;
58
-
59
- if (typeof callback == 'function') {
60
- out.push(callback(currentValue, count, startValue, incrementValue));
61
- } else {
62
- out.push(currentValue);
63
- }
64
- }
65
- return out;
66
- };
67
-
68
- function IterationThing(inObj) {
69
- for (var i in inObj) {
70
- var element = inObj[i];
71
- this[i] = element;
72
- }
73
- }
74
-
75
- if (typeof Number.prototype.qtIterate == 'undefined') {
76
- Object.defineProperty(IterationThing.prototype, 'qtIterate', {
77
- value: iterator,
78
- writable: false,
79
- enumerable: false
80
- });
81
-
82
- Object.defineProperty(IterationThing.prototype, 'qtStart', {
83
- value: setStart,
84
- writable: false,
85
- enumerable: false
86
- });
87
-
88
- Object.defineProperty(IterationThing.prototype, 'qtIncrement', {
89
- value: setIncrement,
90
- writable: false,
91
- enumerable: false
92
- });
93
-
94
- }
95
- //atypical pattern !!!
96
-
97
- //first method definition function ==========================
98
- const firstMethodFunction = commonFunctions => {
99
- const functionObject = new Map(); // prettier-ignore
100
- functionObject.set('qtIterate', {
101
- description: `eg, (5).qtStart(7).qtIncrement(3).qtIterate(item=>item*100)`,
102
- supportedTypeList: [Number],
103
- method: () => iterator
104
- });
105
-
106
- functionObject.set('qtStart', {
107
- description: `placeholder`,
108
- supportedTypeList: [Number],
109
- method: () => setStart
110
- });
111
-
112
- functionObject.set('qtIncrement', {
113
- description: `placeholder`,
114
- supportedTypeList: [Number],
115
- method: () => setIncrement,
116
- test: args => {
117
- return require('./test.js')({
118
- ...args,
119
- ...{
120
- moduleName: module.id.replace(module.path, '')
121
- }
122
- });
123
- }
124
- });
125
- return functionObject;
126
- };
127
- this.addToPrototype = addToPrototypeActual(
128
- firstMethodFunction(commonFunctions)
129
- );
130
-
131
- };
132
-
133
- //END OF moduleFunction() ============================================================
134
-
135
- module.exports = moduleFunction;
136
- //module.exports = new moduleFunction();
137
-
@@ -1,68 +0,0 @@
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
- const testArray = [
42
- 'allocute',
43
- 'Hello'
44
- ];
45
-
46
- // console.dir((5).qtStart(7).qtIncrement(3).qtIterate(item=>item*100))
47
- // [ 700, 1000, 1300, 1600, 1900 ]
48
-
49
- //TEST ITEM ------------------------------------------------------
50
- methodName='qtTemplateMethod'
51
- thisStepMessage = "not yet implemented";
52
- thisStepResult = (5).qtStart(7).qtIncrement(3).qtIterate(item=>item*100);
53
- thisStepEvalFunction = item => item.length=5;
54
- passingTests =
55
- completeStep(methodName, thisStepMessage, thisStepResult, thisStepEvalFunction) &&
56
- passingTests;
57
-
58
-
59
-
60
-
61
- return passingTests;
62
- };
63
-
64
- //END OF moduleFunction() ============================================================
65
-
66
- module.exports = moduleFunction;
67
- //module.exports = new moduleFunction();
68
-
@@ -1,11 +0,0 @@
1
- {
2
- "name": "qtools-number-keys-to-array",
3
- "version": "1.0.0",
4
- "description": "converts an object into an array; optionally keeps holes; if non-numeric keys exist, they are (optionally) pushed as {key:value} elements onto the end of the array.",
5
- "main": "qtools-number-keys-to-array.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "TQ White II",
10
- "license": "ISC"
11
- }