manyfest 1.0.41 → 1.0.43
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.
- package/dist/manyfest.compatible.js +498 -182
- package/dist/manyfest.compatible.js.map +1 -0
- package/dist/manyfest.compatible.min.js +1 -1
- package/dist/manyfest.compatible.min.js.map +1 -1
- package/dist/manyfest.js +487 -173
- package/dist/manyfest.js.map +1 -0
- package/dist/manyfest.min.js +1 -1
- package/dist/manyfest.min.js.map +1 -1
- package/package.json +3 -3
- package/source/Manyfest-CleanWrapCharacters.js +7 -1
- package/source/Manyfest-HashTranslation.js +29 -8
- package/source/Manyfest-ObjectAddress-CheckAddressExists.js +28 -13
- package/source/Manyfest-ObjectAddress-DeleteValue.js +20 -2
- package/source/Manyfest-ObjectAddress-GetValue.js +23 -4
- package/source/Manyfest-ObjectAddress-Parser.js +39 -32
- package/source/Manyfest-ObjectAddress-SetValue.js +14 -2
- package/source/Manyfest-ObjectAddressGeneration.js +23 -12
- package/source/Manyfest-ParseConditionals.js +3 -3
- package/source/Manyfest-SchemaManipulation.js +44 -21
- package/source/Manyfest.js +69 -9
- package/test/Manyfest_Object_Read_tests.js +13 -0
- package/test/Manyfest_Performance_tests.js +48 -0
- package/types/Manyfest-CleanWrapCharacters.d.ts +7 -1
- package/types/Manyfest-CleanWrapCharacters.d.ts.map +1 -1
- package/types/Manyfest-HashTranslation.d.ts +34 -7
- package/types/Manyfest-HashTranslation.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-CheckAddressExists.d.ts +23 -4
- package/types/Manyfest-ObjectAddress-CheckAddressExists.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-DeleteValue.d.ts +25 -6
- package/types/Manyfest-ObjectAddress-DeleteValue.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-GetValue.d.ts +26 -6
- package/types/Manyfest-ObjectAddress-GetValue.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-Parser.d.ts +5 -5
- package/types/Manyfest-ObjectAddress-Parser.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-SetValue.d.ts +18 -5
- package/types/Manyfest-ObjectAddress-SetValue.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddressGeneration.d.ts +25 -4
- package/types/Manyfest-ObjectAddressGeneration.d.ts.map +1 -1
- package/types/Manyfest-SchemaManipulation.d.ts +47 -6
- package/types/Manyfest-SchemaManipulation.d.ts.map +1 -1
- package/types/Manyfest.d.ts +36 -12
- package/types/Manyfest.d.ts.map +1 -1
|
@@ -10,6 +10,10 @@ let libSimpleLog = require('./Manyfest-LogToConsole.js');
|
|
|
10
10
|
*/
|
|
11
11
|
class ManyfestSchemaManipulation
|
|
12
12
|
{
|
|
13
|
+
/**
|
|
14
|
+
* @param {function} [pInfoLog] - (optional) A logging function for info messages
|
|
15
|
+
* @param {function} [pErrorLog] - (optional) A logging function for error messages
|
|
16
|
+
*/
|
|
13
17
|
constructor(pInfoLog, pErrorLog)
|
|
14
18
|
{
|
|
15
19
|
// Wire in logging
|
|
@@ -17,24 +21,31 @@ class ManyfestSchemaManipulation
|
|
|
17
21
|
this.logError = (typeof(pErrorLog) === 'function') ? pErrorLog : libSimpleLog;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
/**
|
|
25
|
+
* This translates the default address mappings to something different.
|
|
26
|
+
*
|
|
27
|
+
* For instance you can pass in manyfest schema descriptor object:
|
|
28
|
+
* {
|
|
29
|
+
* "Address.Of.a": { "Hash": "a", "Type": "Number" },
|
|
30
|
+
* "Address.Of.b": { "Hash": "b", "Type": "Number" }
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
*
|
|
34
|
+
* And then an address mapping (basically a Hash->Address map)
|
|
35
|
+
* {
|
|
36
|
+
* "a": "New.Address.Of.a",
|
|
37
|
+
* "b": "New.Address.Of.b"
|
|
38
|
+
* }
|
|
39
|
+
*
|
|
40
|
+
* NOTE: This mutates the schema object permanently, altering the base hash.
|
|
41
|
+
* If there is a collision with an existing address, it can lead to overwrites.
|
|
42
|
+
* TODO: Discuss what should happen on collisions.
|
|
43
|
+
*
|
|
44
|
+
* @param {object} pManyfestSchemaDescriptors - The manyfest schema descriptors to resolve address mappings for
|
|
45
|
+
* @param {object} pAddressMapping - The address mapping object to use for remapping
|
|
46
|
+
*
|
|
47
|
+
* @return {boolean} True if successful, false if there was an error
|
|
48
|
+
*/
|
|
38
49
|
resolveAddressMappings(pManyfestSchemaDescriptors, pAddressMapping)
|
|
39
50
|
{
|
|
40
51
|
if (typeof(pManyfestSchemaDescriptors) != 'object')
|
|
@@ -67,8 +78,8 @@ class ManyfestSchemaManipulation
|
|
|
67
78
|
(pInputAddress) =>
|
|
68
79
|
{
|
|
69
80
|
let tmpNewDescriptorAddress = pAddressMapping[pInputAddress];
|
|
70
|
-
let tmpOldDescriptorAddress =
|
|
71
|
-
let tmpDescriptor
|
|
81
|
+
let tmpOldDescriptorAddress = null;
|
|
82
|
+
let tmpDescriptor;
|
|
72
83
|
|
|
73
84
|
// See if there is a matching descriptor either by Address directly or Hash
|
|
74
85
|
if (pInputAddress in pManyfestSchemaDescriptors)
|
|
@@ -99,6 +110,12 @@ class ManyfestSchemaManipulation
|
|
|
99
110
|
return true;
|
|
100
111
|
}
|
|
101
112
|
|
|
113
|
+
/**
|
|
114
|
+
* @param {object} pManyfestSchemaDescriptors - The manyfest schema descriptors to resolve address mappings for
|
|
115
|
+
* @param {object} pAddressMapping - The address mapping object to use for remapping
|
|
116
|
+
*
|
|
117
|
+
* @return {object} A new object containing the remapped schema descriptors
|
|
118
|
+
*/
|
|
102
119
|
safeResolveAddressMappings(pManyfestSchemaDescriptors, pAddressMapping)
|
|
103
120
|
{
|
|
104
121
|
// This returns the descriptors as a new object, safely remapping without mutating the original schema Descriptors
|
|
@@ -107,6 +124,12 @@ class ManyfestSchemaManipulation
|
|
|
107
124
|
return tmpManyfestSchemaDescriptors;
|
|
108
125
|
}
|
|
109
126
|
|
|
127
|
+
/**
|
|
128
|
+
* @param {object} pManyfestSchemaDescriptorsDestination - The destination manyfest schema descriptors
|
|
129
|
+
* @param {object} pManyfestSchemaDescriptorsSource - The source manyfest schema descriptors
|
|
130
|
+
*
|
|
131
|
+
* @return {object} A new object containing the merged schema descriptors
|
|
132
|
+
*/
|
|
110
133
|
mergeAddressMappings(pManyfestSchemaDescriptorsDestination, pManyfestSchemaDescriptorsSource)
|
|
111
134
|
{
|
|
112
135
|
if ((typeof(pManyfestSchemaDescriptorsSource) != 'object') || (typeof(pManyfestSchemaDescriptorsDestination) != 'object'))
|
|
@@ -134,4 +157,4 @@ class ManyfestSchemaManipulation
|
|
|
134
157
|
}
|
|
135
158
|
}
|
|
136
159
|
|
|
137
|
-
module.exports = ManyfestSchemaManipulation;
|
|
160
|
+
module.exports = ManyfestSchemaManipulation;
|
package/source/Manyfest.js
CHANGED
|
@@ -45,8 +45,14 @@ class Manyfest extends libFableServiceProviderBase
|
|
|
45
45
|
super(pFable, pManifest, pServiceHash);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/** @type {import('fable')} */
|
|
49
|
+
this.fable;
|
|
48
50
|
/** @type {Record<string, any>} */
|
|
49
51
|
this.options;
|
|
52
|
+
/** @type {string} */
|
|
53
|
+
this.Hash;
|
|
54
|
+
/** @type {string} */
|
|
55
|
+
this.UUID;
|
|
50
56
|
|
|
51
57
|
this.serviceType = 'Manifest';
|
|
52
58
|
|
|
@@ -82,9 +88,13 @@ class Manyfest extends libFableServiceProviderBase
|
|
|
82
88
|
this.options.strict = false;
|
|
83
89
|
}
|
|
84
90
|
|
|
91
|
+
/** @type {string} */
|
|
85
92
|
this.scope = undefined;
|
|
93
|
+
/** @type {Array<string>} */
|
|
86
94
|
this.elementAddresses = undefined;
|
|
95
|
+
/** @type {Record<string, string>} */
|
|
87
96
|
this.elementHashes = undefined;
|
|
97
|
+
/** @type {Record<string, ManifestDescriptor>} */
|
|
88
98
|
this.elementDescriptors = undefined;
|
|
89
99
|
|
|
90
100
|
this.reset();
|
|
@@ -120,7 +130,25 @@ class Manyfest extends libFableServiceProviderBase
|
|
|
120
130
|
// Make a copy of the options in-place
|
|
121
131
|
let tmpNewOptions = JSON.parse(JSON.stringify(this.options));
|
|
122
132
|
|
|
123
|
-
let tmpNewManyfest = new Manyfest(this.
|
|
133
|
+
let tmpNewManyfest = new Manyfest(this.fable, tmpNewOptions, this.Hash);
|
|
134
|
+
tmpNewManyfest.logInfo = this.logInfo;
|
|
135
|
+
tmpNewManyfest.logError = this.logError;
|
|
136
|
+
//FIXME: mostly written by co-pilot
|
|
137
|
+
const { Scope, Descriptors, HashTranslations } = this.getManifest();
|
|
138
|
+
tmpNewManyfest.scope = Scope;
|
|
139
|
+
tmpNewManyfest.elementDescriptors = Descriptors;
|
|
140
|
+
tmpNewManyfest.elementAddresses = Object.keys(Descriptors);
|
|
141
|
+
// Rebuild the element hashes
|
|
142
|
+
for (let i = 0; i < tmpNewManyfest.elementAddresses.length; i++)
|
|
143
|
+
{
|
|
144
|
+
let tmpAddress = tmpNewManyfest.elementAddresses[i];
|
|
145
|
+
let tmpDescriptor = tmpNewManyfest.elementDescriptors[tmpAddress];
|
|
146
|
+
tmpNewManyfest.elementHashes[tmpAddress] = tmpAddress;
|
|
147
|
+
if ('Hash' in tmpDescriptor)
|
|
148
|
+
{
|
|
149
|
+
tmpNewManyfest.elementHashes[tmpDescriptor.Hash] = tmpAddress;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
124
152
|
|
|
125
153
|
// Import the hash translations
|
|
126
154
|
tmpNewManyfest.hashTranslations.addTranslation(this.hashTranslations.translationTable);
|
|
@@ -129,10 +157,16 @@ class Manyfest extends libFableServiceProviderBase
|
|
|
129
157
|
}
|
|
130
158
|
|
|
131
159
|
// Deserialize a Manifest from a string
|
|
160
|
+
/**
|
|
161
|
+
* @param {string} pManifestString - The manifest string to deserialize
|
|
162
|
+
*
|
|
163
|
+
* @return {Manyfest} The deserialized manifest
|
|
164
|
+
*/
|
|
132
165
|
deserialize(pManifestString)
|
|
133
166
|
{
|
|
134
167
|
// TODO: Add guards for bad manifest string
|
|
135
|
-
|
|
168
|
+
this.loadManifest(JSON.parse(pManifestString));
|
|
169
|
+
return this;
|
|
136
170
|
}
|
|
137
171
|
|
|
138
172
|
// Load a manifest from an object
|
|
@@ -197,18 +231,26 @@ class Manyfest extends libFableServiceProviderBase
|
|
|
197
231
|
{
|
|
198
232
|
for (let i = 0; i < tmpManifest.HashTranslations.length; i++)
|
|
199
233
|
{
|
|
200
|
-
// Each translation is
|
|
234
|
+
// Each translation is
|
|
235
|
+
//FIXME: ?????????
|
|
201
236
|
}
|
|
202
237
|
}
|
|
203
238
|
}
|
|
204
239
|
}
|
|
205
240
|
|
|
206
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Serialize the Manifest to a string
|
|
243
|
+
*
|
|
244
|
+
* @return {string} - The serialized manifest
|
|
245
|
+
*/
|
|
207
246
|
serialize()
|
|
208
247
|
{
|
|
209
248
|
return JSON.stringify(this.getManifest());
|
|
210
249
|
}
|
|
211
250
|
|
|
251
|
+
/**
|
|
252
|
+
* @return {{ Scope: string, Descriptors: Record<string, ManifestDescriptor>, HashTranslations: Record<string, string> }} - A copy of the manifest state.
|
|
253
|
+
*/
|
|
212
254
|
getManifest()
|
|
213
255
|
{
|
|
214
256
|
return (
|
|
@@ -362,21 +404,37 @@ class Manyfest extends libFableServiceProviderBase
|
|
|
362
404
|
return tmpValue;
|
|
363
405
|
}
|
|
364
406
|
|
|
407
|
+
lintAddress(pAddress)
|
|
408
|
+
{
|
|
409
|
+
let tmpLintedAddress = pAddress.trim();
|
|
410
|
+
// Check for a single . (but not a ..) at the end of the address and remove it.
|
|
411
|
+
if (tmpLintedAddress.endsWith('..'))
|
|
412
|
+
{
|
|
413
|
+
tmpLintedAddress = tmpLintedAddress.slice(0, -1);
|
|
414
|
+
}
|
|
415
|
+
else if (tmpLintedAddress.endsWith('.'))
|
|
416
|
+
{
|
|
417
|
+
tmpLintedAddress = tmpLintedAddress.slice(0, -1);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return tmpLintedAddress;
|
|
421
|
+
}
|
|
422
|
+
|
|
365
423
|
// Get the value of an element at an address
|
|
366
424
|
getValueAtAddress (pObject, pAddress)
|
|
367
425
|
{
|
|
368
|
-
let tmpLintedAddress =
|
|
426
|
+
let tmpLintedAddress = this.lintAddress(pAddress);
|
|
369
427
|
if (tmpLintedAddress == '')
|
|
370
428
|
{
|
|
371
429
|
this.logError(`(${this.scope}) Error getting value at address; address is an empty string.`, pObject);
|
|
372
430
|
return undefined;
|
|
373
431
|
}
|
|
374
|
-
let tmpValue = this.objectAddressGetValue.getValueAtAddress(pObject,
|
|
432
|
+
let tmpValue = this.objectAddressGetValue.getValueAtAddress(pObject, tmpLintedAddress);
|
|
375
433
|
|
|
376
434
|
if (typeof(tmpValue) == 'undefined')
|
|
377
435
|
{
|
|
378
436
|
// Try to get a default if it exists
|
|
379
|
-
tmpValue = this.getDefaultValue(this.getDescriptor(
|
|
437
|
+
tmpValue = this.getDefaultValue(this.getDescriptor(tmpLintedAddress));
|
|
380
438
|
}
|
|
381
439
|
|
|
382
440
|
return tmpValue;
|
|
@@ -391,7 +449,8 @@ class Manyfest extends libFableServiceProviderBase
|
|
|
391
449
|
// Set the value of an element at an address
|
|
392
450
|
setValueAtAddress (pObject, pAddress, pValue)
|
|
393
451
|
{
|
|
394
|
-
|
|
452
|
+
let tmpLintedAddress = this.lintAddress(pAddress);
|
|
453
|
+
return this.objectAddressSetValue.setValueAtAddress(pObject, tmpLintedAddress, pValue);
|
|
395
454
|
}
|
|
396
455
|
|
|
397
456
|
// Delete the value of an element by its hash
|
|
@@ -403,7 +462,8 @@ class Manyfest extends libFableServiceProviderBase
|
|
|
403
462
|
// Delete the value of an element at an address
|
|
404
463
|
deleteValueAtAddress (pObject, pAddress, pValue)
|
|
405
464
|
{
|
|
406
|
-
|
|
465
|
+
let tmpLintedAddress = this.lintAddress(pAddress);
|
|
466
|
+
return this.objectAddressDeleteValue.deleteValueAtAddress(pObject, tmpLintedAddress, pValue);
|
|
407
467
|
}
|
|
408
468
|
|
|
409
469
|
// Validate the consistency of an object against the schema
|
|
@@ -160,6 +160,19 @@ suite
|
|
|
160
160
|
}
|
|
161
161
|
);
|
|
162
162
|
test
|
|
163
|
+
(
|
|
164
|
+
'Access relative objects with invalid dots',
|
|
165
|
+
(fTestComplete)=>
|
|
166
|
+
{
|
|
167
|
+
let _Manyfest = new libManyfest();
|
|
168
|
+
Expect(_Manyfest.getValueAtAddress(_SampleDataYahooWeather, 'location.city')).to.equal('Sunnyvale');
|
|
169
|
+
Expect(_Manyfest.getValueAtAddress(_SampleDataYahooWeather, 'location.city.')).to.equal('Sunnyvale');
|
|
170
|
+
Expect(_Manyfest.getValueAtAddress(_SampleDataYahooWeather, 'current_observation.wind.').chill).to.equal(59);
|
|
171
|
+
Expect(_Manyfest.getValueAtAddress(_SampleDataYahooWeather, 'current_observation.BadObjectPropertyName.')).to.equal(undefined);
|
|
172
|
+
fTestComplete();
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
test
|
|
163
176
|
(
|
|
164
177
|
'Access specific array elements',
|
|
165
178
|
(fTestComplete)=>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for Manyfest
|
|
3
|
+
*
|
|
4
|
+
* @license MIT
|
|
5
|
+
*
|
|
6
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var Chai = require('chai');
|
|
10
|
+
var Expect = Chai.expect;
|
|
11
|
+
|
|
12
|
+
let libManyfest = require('../source/Manyfest.js');
|
|
13
|
+
|
|
14
|
+
suite
|
|
15
|
+
(
|
|
16
|
+
'Manyfest Performance',
|
|
17
|
+
function()
|
|
18
|
+
{
|
|
19
|
+
suite
|
|
20
|
+
(
|
|
21
|
+
'Brute Force Performance Tests',
|
|
22
|
+
()=>
|
|
23
|
+
{
|
|
24
|
+
test
|
|
25
|
+
(
|
|
26
|
+
'Deep Address Performance Test',
|
|
27
|
+
()=>
|
|
28
|
+
{
|
|
29
|
+
let _Manyfest = new libManyfest();
|
|
30
|
+
const tmpData = {};
|
|
31
|
+
const tmpValueAddress = 'level1.level2.level3.level4.level5';
|
|
32
|
+
const tmpNumIterations = 200000;
|
|
33
|
+
// start timing
|
|
34
|
+
console.time('Brute Force Initial Load Performance Test');
|
|
35
|
+
for (let i = 0; i < tmpNumIterations; i++)
|
|
36
|
+
{
|
|
37
|
+
const tmpUpdatedValue = (_Manyfest.getValueAtAddress(tmpData, tmpValueAddress) || 0) + 1;
|
|
38
|
+
_Manyfest.setValueAtAddress(tmpData, tmpValueAddress, tmpUpdatedValue);
|
|
39
|
+
}
|
|
40
|
+
// stop timing
|
|
41
|
+
console.timeEnd('Brute Force Initial Load Performance Test', { tmpData });
|
|
42
|
+
Expect(_Manyfest.getValueAtAddress(tmpData, tmpValueAddress)).to.equal(tmpNumIterations);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export = cleanWrapCharacters;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @param {string} pCharacter - The character to remove from the start and end of the string
|
|
4
|
+
* @param {string} pString - The string to clean
|
|
5
|
+
*
|
|
6
|
+
* @return {string} The cleaned string
|
|
7
|
+
*/
|
|
8
|
+
declare function cleanWrapCharacters(pCharacter: string, pString: string): string;
|
|
3
9
|
//# sourceMappingURL=Manyfest-CleanWrapCharacters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest-CleanWrapCharacters.d.ts","sourceRoot":"","sources":["../source/Manyfest-CleanWrapCharacters.js"],"names":[],"mappings":";AAeA,
|
|
1
|
+
{"version":3,"file":"Manyfest-CleanWrapCharacters.d.ts","sourceRoot":"","sources":["../source/Manyfest-CleanWrapCharacters.js"],"names":[],"mappings":";AAeA;;;;;GAKG;AACH,iDALW,MAAM,WACN,MAAM,GAEL,MAAM,CAYjB"}
|
|
@@ -15,15 +15,42 @@ export = ManyfestHashTranslation;
|
|
|
15
15
|
* @class ManyfestHashTranslation
|
|
16
16
|
*/
|
|
17
17
|
declare class ManyfestHashTranslation {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @param {function} [pInfoLog] - (optional) A logging function for info messages
|
|
20
|
+
* @param {function} [pErrorLog] - (optional) A logging function for error messages
|
|
21
|
+
*/
|
|
22
|
+
constructor(pInfoLog?: Function, pErrorLog?: Function);
|
|
23
|
+
logInfo: Function;
|
|
24
|
+
logError: Function;
|
|
21
25
|
translationTable: {};
|
|
26
|
+
/**
|
|
27
|
+
* @return {number} The number of translations in the table
|
|
28
|
+
*/
|
|
22
29
|
translationCount(): number;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @param {object} pTranslation - An object containing source:destination hash pairs to add to the translation table
|
|
32
|
+
*/
|
|
33
|
+
addTranslation(pTranslation: object): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* @param {string} pTranslationHash - The source hash to remove from the translation table
|
|
36
|
+
*/
|
|
37
|
+
removeTranslationHash(pTranslationHash: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* This removes translations.
|
|
40
|
+
* If passed a string, just removes the single one.
|
|
41
|
+
* If passed an object, it does all the source keys.
|
|
42
|
+
*
|
|
43
|
+
* @param {string|object} pTranslation - Either a source hash string to remove, or an object containing source:destination hash pairs to remove
|
|
44
|
+
*
|
|
45
|
+
* @return {boolean} True if the removal was successful, false otherwise
|
|
46
|
+
*/
|
|
47
|
+
removeTranslation(pTranslation: string | object): boolean;
|
|
26
48
|
clearTranslations(): void;
|
|
27
|
-
|
|
49
|
+
/**
|
|
50
|
+
* @param {string} pTranslation - The source hash to translate
|
|
51
|
+
*
|
|
52
|
+
* @return {string} The translated hash, or the original if no translation exists
|
|
53
|
+
*/
|
|
54
|
+
translate(pTranslation: string): string;
|
|
28
55
|
}
|
|
29
56
|
//# sourceMappingURL=Manyfest-HashTranslation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest-HashTranslation.d.ts","sourceRoot":"","sources":["../source/Manyfest-HashTranslation.js"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;EAcE;AACF;
|
|
1
|
+
{"version":3,"file":"Manyfest-HashTranslation.d.ts","sourceRoot":"","sources":["../source/Manyfest-HashTranslation.js"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;EAcE;AACF;IAEI;;;OAGG;IACN,uDAOC;IAJA,kBAA0E;IAC1E,mBAA6E;IAEvE,qBAA0B;IAG9B;;OAEG;IACH,oBAFY,MAAM,CAKjB;IAED;;OAEG;IACH,6BAFW,MAAM,WA0BhB;IAED;;OAEG;IACH,wCAFW,MAAM,QAKhB;IAED;;;;;;;;OAQG;IACH,gCAJW,MAAM,GAAC,MAAM,GAEZ,OAAO,CAyBlB;IAED,0BAGC;IAED;;;;OAIG;IACH,wBAJW,MAAM,GAEL,MAAM,CAYjB;CACJ"}
|
|
@@ -18,11 +18,30 @@ export = ManyfestObjectAddressResolverCheckAddressExists;
|
|
|
18
18
|
* @class ManyfestObjectAddressResolverCheckAddressExists
|
|
19
19
|
*/
|
|
20
20
|
declare class ManyfestObjectAddressResolverCheckAddressExists {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @param {function} [pInfoLog] - (optional) Function to use for info logging
|
|
23
|
+
* @param {function} [pErrorLog] - (optional) Function to use for error logging
|
|
24
|
+
*/
|
|
25
|
+
constructor(pInfoLog?: Function, pErrorLog?: Function);
|
|
26
|
+
logInfo: Function;
|
|
27
|
+
logError: Function;
|
|
24
28
|
getObjectValueClass: libGetObjectValue;
|
|
25
|
-
|
|
29
|
+
cleanWrapCharacters: (pCharacter: string, pString: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Check if an address exists.
|
|
32
|
+
*
|
|
33
|
+
* This is necessary because the getValueAtAddress function is ambiguous on
|
|
34
|
+
* whether the element/property is actually there or not (it returns
|
|
35
|
+
* undefined whether the property exists or not). This function checks for
|
|
36
|
+
* existance and returns true or false dependent.
|
|
37
|
+
*
|
|
38
|
+
* @param {object} pObject - The object to check within
|
|
39
|
+
* @param {string} pAddress - The address to check for
|
|
40
|
+
* @param {object} [pRootObject] - (optional) The root object for function resolution context
|
|
41
|
+
*
|
|
42
|
+
* @return {boolean} - True if the address exists, false if it does not
|
|
43
|
+
*/
|
|
44
|
+
checkAddressExists(pObject: object, pAddress: string, pRootObject?: object): boolean;
|
|
26
45
|
}
|
|
27
46
|
import libGetObjectValue = require("./Manyfest-ObjectAddress-GetValue.js");
|
|
28
47
|
//# sourceMappingURL=Manyfest-ObjectAddress-CheckAddressExists.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest-ObjectAddress-CheckAddressExists.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-CheckAddressExists.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Manyfest-ObjectAddress-CheckAddressExists.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-CheckAddressExists.js"],"names":[],"mappings":";AAYA;;;;;;;;;;;;;;;;;EAiBE;AACF;IAEC;;;OAGG;IACH,uDAQC;IALA,kBAAyE;IACzE,mBAA4E;IAE5E,uCAA6E;IAC7E,qEAA+C;IAGhD;;;;;;;;;;;;;OAaG;IACH,4BANW,MAAM,YACN,MAAM,gBACN,MAAM,GAEL,OAAO,CA4SlB;CACD"}
|
|
@@ -20,11 +20,30 @@ export = ManyfestObjectAddressResolverDeleteValue;
|
|
|
20
20
|
* @class ManyfestObjectAddressResolverDeleteValue
|
|
21
21
|
*/
|
|
22
22
|
declare class ManyfestObjectAddressResolverDeleteValue {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @param {function} [pInfoLog] - (optional) A logging function for info messages
|
|
25
|
+
* @param {function} [pErrorLog] - (optional) A logging function for error messages
|
|
26
|
+
*/
|
|
27
|
+
constructor(pInfoLog?: Function, pErrorLog?: Function);
|
|
28
|
+
logInfo: Function;
|
|
29
|
+
logError: Function;
|
|
30
|
+
cleanWrapCharacters: (pCharacter: string, pString: string) => string;
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} pAddress - The address being evaluated
|
|
33
|
+
* @param {object} pRecord - The record being evaluated
|
|
34
|
+
*
|
|
35
|
+
* @return {boolean} True if the record passes the filters, false if it does not
|
|
36
|
+
*/
|
|
37
|
+
checkRecordFilters(pAddress: string, pRecord: object): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Delete the value of an element at an address
|
|
40
|
+
*
|
|
41
|
+
* @param {object} pObject - The object to delete the value from
|
|
42
|
+
* @param {string} pAddress - The address to delete the value at
|
|
43
|
+
* @param {string} [pParentAddress] - (optional) The parent address for recursion
|
|
44
|
+
*
|
|
45
|
+
* @return {boolean|object|undefined} - True if the value was deleted, false if it could not be deleted, undefined on error
|
|
46
|
+
*/
|
|
47
|
+
deleteValueAtAddress(pObject: object, pAddress: string, pParentAddress?: string): boolean | object | undefined;
|
|
29
48
|
}
|
|
30
49
|
//# sourceMappingURL=Manyfest-ObjectAddress-DeleteValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest-ObjectAddress-DeleteValue.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-DeleteValue.js"],"names":[],"mappings":";AAOA;;;;;;;;;;;;;;;;;;;EAmBE;AACF;IAEC,
|
|
1
|
+
{"version":3,"file":"Manyfest-ObjectAddress-DeleteValue.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-DeleteValue.js"],"names":[],"mappings":";AAOA;;;;;;;;;;;;;;;;;;;EAmBE;AACF;IAEC;;;OAGG;IACH,uDAOC;IAJA,kBAAyE;IACzE,mBAA4E;IAE5E,qEAA+C;IAIhD;;;;;OAKG;IACH,6BALW,MAAM,WACN,MAAM,GAEL,OAAO,CAKlB;IAED;;;;;;;;OAQG;IACH,8BANW,MAAM,YACN,MAAM,mBACN,MAAM,GAEL,OAAO,GAAC,MAAM,GAAC,SAAS,CAoTnC;CACD"}
|
|
@@ -20,11 +20,31 @@ export = ManyfestObjectAddressResolverGetValue;
|
|
|
20
20
|
* @class ManyfestObjectAddressResolverGetValue
|
|
21
21
|
*/
|
|
22
22
|
declare class ManyfestObjectAddressResolverGetValue {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @param {function} [pInfoLog] - (optional) A logging function for info messages
|
|
25
|
+
* @param {function} [pErrorLog] - (optional) A logging function for error messages
|
|
26
|
+
*/
|
|
27
|
+
constructor(pInfoLog?: Function, pErrorLog?: Function);
|
|
28
|
+
logInfo: Function;
|
|
29
|
+
logError: Function;
|
|
30
|
+
cleanWrapCharacters: (pCharacter: string, pString: string) => string;
|
|
31
|
+
/**
|
|
32
|
+
* @param {string} pAddress - The address of the record to check
|
|
33
|
+
* @param {object} pRecord - The record to check against the filters
|
|
34
|
+
*
|
|
35
|
+
* @return {boolean} - True if the record passes the filters, false otherwise
|
|
36
|
+
*/
|
|
37
|
+
checkRecordFilters(pAddress: string, pRecord: object): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get the value of an element at an address
|
|
40
|
+
*
|
|
41
|
+
* @param {object} pObject - The object to resolve the address against
|
|
42
|
+
* @param {string} pAddress - The address to resolve
|
|
43
|
+
* @param {string} [pParentAddress] - (optional) The parent address for back-navigation
|
|
44
|
+
* @param {object} [pRootObject] - (optional) The root object for function argument resolution
|
|
45
|
+
*
|
|
46
|
+
* @return {any} The value at the address, or undefined if not found
|
|
47
|
+
*/
|
|
48
|
+
getValueAtAddress(pObject: object, pAddress: string, pParentAddress?: string, pRootObject?: object): any;
|
|
29
49
|
}
|
|
30
50
|
//# sourceMappingURL=Manyfest-ObjectAddress-GetValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest-ObjectAddress-GetValue.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-GetValue.js"],"names":[],"mappings":";AASA;;;;;;;;;;;;;;;;;;;EAmBE;AACF;IAEC,
|
|
1
|
+
{"version":3,"file":"Manyfest-ObjectAddress-GetValue.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-GetValue.js"],"names":[],"mappings":";AASA;;;;;;;;;;;;;;;;;;;EAmBE;AACF;IAEC;;;OAGG;IACH,uDAOC;IAJA,kBAAyE;IACzE,mBAA4E;IAE5E,qEAA+C;IAGhD;;;;;OAKG;IACH,6BALW,MAAM,WACN,MAAM,GAEL,OAAO,CAKlB;IAED;;;;;;;;;OASG;IACH,2BAPW,MAAM,YACN,MAAM,mBACN,MAAM,gBACN,MAAM,GAEL,GAAG,CA0kBd;CACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export function stringCountSegments(pString: string, pSeparator
|
|
2
|
-
export function stringGetFirstSegment(pString: string, pSeparator
|
|
3
|
-
export function stringGetSegments(pString: string, pSeparator
|
|
4
|
-
export function stringCountEnclosures(pString: string, pEnclosureStart
|
|
5
|
-
export function stringGetEnclosureValueByIndex(pString: string, pEnclosureIndexToGet: number, pEnclosureStart
|
|
1
|
+
export function stringCountSegments(pString: string, pSeparator?: string, pEnclosureStartSymbolMap?: Record<string, number>, pEnclosureEndSymbolMap?: Record<string, number>): number;
|
|
2
|
+
export function stringGetFirstSegment(pString: string, pSeparator?: string, pEnclosureStartSymbolMap?: Record<string, number>, pEnclosureEndSymbolMap?: Record<string, number>): string;
|
|
3
|
+
export function stringGetSegments(pString: string, pSeparator?: string, pEnclosureStartSymbolMap?: Record<string, number>, pEnclosureEndSymbolMap?: Record<string, number>): Array<string>;
|
|
4
|
+
export function stringCountEnclosures(pString: string, pEnclosureStart?: string, pEnclosureEnd?: string): number;
|
|
5
|
+
export function stringGetEnclosureValueByIndex(pString: string, pEnclosureIndexToGet: number, pEnclosureStart?: string, pEnclosureEnd?: string): string;
|
|
6
6
|
//# sourceMappingURL=Manyfest-ObjectAddress-Parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest-ObjectAddress-Parser.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-Parser.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Manyfest-ObjectAddress-Parser.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-Parser.js"],"names":[],"mappings":"AAwBsB,6CAPV,MAAM,eACN,MAAM,6BACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,2BACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAErB,MAAM,CA8CjB;AAYsB,+CAPZ,MAAM,eACN,MAAM,6BACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,2BACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAErB,MAAM,CA6CjB;AAYkB,2CAPR,MAAM,eACN,MAAM,6BACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,2BACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAErB,KAAK,CAAC,MAAM,CAAC,CAsDxB;AAYsB,+CALZ,MAAM,oBACN,MAAM,kBACN,MAAM,UA6BhB;AAe+B,wDAPrB,MAAM,wBACN,MAAM,oBACN,MAAM,kBACN,MAAM,GAEL,MAAM,CAiEjB"}
|
|
@@ -18,10 +18,23 @@ export = ManyfestObjectAddressSetValue;
|
|
|
18
18
|
* @class ManyfestObjectAddressSetValue
|
|
19
19
|
*/
|
|
20
20
|
declare class ManyfestObjectAddressSetValue {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @param {function} [pInfoLog] - (optional) A logging function for info messages
|
|
23
|
+
* @param {function} [pErrorLog] - (optional) A logging function for error messages
|
|
24
|
+
*/
|
|
25
|
+
constructor(pInfoLog?: Function, pErrorLog?: Function);
|
|
26
|
+
logInfo: Function;
|
|
27
|
+
logError: Function;
|
|
28
|
+
cleanWrapCharacters: (pCharacter: string, pString: string) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Set the value of an element at an address
|
|
31
|
+
*
|
|
32
|
+
* @param {object} pObject - The object to set the value in
|
|
33
|
+
* @param {string} pAddress - The address to set the value at
|
|
34
|
+
* @param {any} pValue - The value to set at the address
|
|
35
|
+
*
|
|
36
|
+
* @return {boolean} True if the value was set, false otherwise
|
|
37
|
+
*/
|
|
38
|
+
setValueAtAddress(pObject: object, pAddress: string, pValue: any): boolean;
|
|
26
39
|
}
|
|
27
40
|
//# sourceMappingURL=Manyfest-ObjectAddress-SetValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest-ObjectAddress-SetValue.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-SetValue.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;;;;EAiBE;AACF;IAEC,
|
|
1
|
+
{"version":3,"file":"Manyfest-ObjectAddress-SetValue.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-SetValue.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;;;;EAiBE;AACF;IAEC;;;OAGG;IACH,uDAOC;IAJA,kBAAyE;IACzE,mBAA4E;IAE5E,qEAA+C;IAGhD;;;;;;;;OAQG;IACH,2BANW,MAAM,YACN,MAAM,UACN,GAAG,GAEF,OAAO,CAkOlB;CACD"}
|
|
@@ -22,9 +22,30 @@ export = ManyfestObjectAddressGeneration;
|
|
|
22
22
|
* @class ManyfestObjectAddressGeneration
|
|
23
23
|
*/
|
|
24
24
|
declare class ManyfestObjectAddressGeneration {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @param {function} [pInfoLog] - (optional) A logging function for info messages
|
|
27
|
+
* @param {function} [pErrorLog] - (optional) A logging function for error messages
|
|
28
|
+
*/
|
|
29
|
+
constructor(pInfoLog?: Function, pErrorLog?: Function);
|
|
30
|
+
logInfo: Function;
|
|
31
|
+
logError: Function;
|
|
32
|
+
/**
|
|
33
|
+
* generateAddressses
|
|
34
|
+
*
|
|
35
|
+
* This flattens an object into a set of key:value pairs for *EVERY SINGLE
|
|
36
|
+
* POSSIBLE ADDRESS* in the object. It can get ... really insane really
|
|
37
|
+
* quickly. This is not meant to be used directly to generate schemas, but
|
|
38
|
+
* instead as a starting point for scripts or UIs.
|
|
39
|
+
*
|
|
40
|
+
* This will return a mega set of key:value pairs with all possible schema
|
|
41
|
+
* permutations and default values (when not an object) and everything else.
|
|
42
|
+
*
|
|
43
|
+
* @param {any} pObject - The object to generate addresses for
|
|
44
|
+
* @param {string} [pBaseAddress] - (optional) The base address to start from
|
|
45
|
+
* @param {object} [pSchema] - (optional) The schema object to append to
|
|
46
|
+
*
|
|
47
|
+
* @return {object} The generated schema object
|
|
48
|
+
*/
|
|
49
|
+
generateAddressses(pObject: any, pBaseAddress?: string, pSchema?: object): object;
|
|
29
50
|
}
|
|
30
51
|
//# sourceMappingURL=Manyfest-ObjectAddressGeneration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest-ObjectAddressGeneration.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddressGeneration.js"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;;;;;;;;EAqBE;AACF;IAEC,
|
|
1
|
+
{"version":3,"file":"Manyfest-ObjectAddressGeneration.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddressGeneration.js"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;;;;;;;;EAqBE;AACF;IAEC;;;OAGG;IACH,uDAKC;IAFA,kBAAyE;IACzE,mBAA4E;IAG7E;;;;;;;;;;;;;;;;OAgBG;IACH,4BANW,GAAG,iBACH,MAAM,YACN,MAAM,GAEL,MAAM,CAgFjB;CACD"}
|