manyfest 1.0.41 → 1.0.42
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 +219 -70
- 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 +207 -61
- 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.js +23 -5
- package/test/Manyfest_Object_Read_tests.js +13 -0
- package/types/Manyfest.d.ts +1 -0
- package/types/Manyfest.d.ts.map +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
4
|
-
function _possibleConstructorReturn(
|
|
5
|
-
function _assertThisInitialized(
|
|
4
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
5
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
6
6
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
7
|
-
function _getPrototypeOf(
|
|
8
|
-
function _inherits(
|
|
9
|
-
function _setPrototypeOf(
|
|
10
|
-
function _classCallCheck(
|
|
11
|
-
function _defineProperties(
|
|
12
|
-
function _createClass(
|
|
13
|
-
function _defineProperty(
|
|
7
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
8
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
9
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
14
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
15
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
16
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
@@ -61,10 +61,53 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
61
61
|
return r;
|
|
62
62
|
}()({
|
|
63
63
|
1: [function (require, module, exports) {
|
|
64
|
+
module.exports = {
|
|
65
|
+
"name": "fable-serviceproviderbase",
|
|
66
|
+
"version": "3.0.15",
|
|
67
|
+
"description": "Simple base classes for fable services.",
|
|
68
|
+
"main": "source/Fable-ServiceProviderBase.js",
|
|
69
|
+
"scripts": {
|
|
70
|
+
"start": "node source/Fable-ServiceProviderBase.js",
|
|
71
|
+
"test": "npx mocha -u tdd -R spec",
|
|
72
|
+
"tests": "npx mocha -u tdd --exit -R spec --grep",
|
|
73
|
+
"coverage": "npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",
|
|
74
|
+
"build": "npx quack build"
|
|
75
|
+
},
|
|
76
|
+
"mocha": {
|
|
77
|
+
"diff": true,
|
|
78
|
+
"extension": ["js"],
|
|
79
|
+
"package": "./package.json",
|
|
80
|
+
"reporter": "spec",
|
|
81
|
+
"slow": "75",
|
|
82
|
+
"timeout": "5000",
|
|
83
|
+
"ui": "tdd",
|
|
84
|
+
"watch-files": ["source/**/*.js", "test/**/*.js"],
|
|
85
|
+
"watch-ignore": ["lib/vendor"]
|
|
86
|
+
},
|
|
87
|
+
"repository": {
|
|
88
|
+
"type": "git",
|
|
89
|
+
"url": "https://github.com/stevenvelozo/fable-serviceproviderbase.git"
|
|
90
|
+
},
|
|
91
|
+
"keywords": ["entity", "behavior"],
|
|
92
|
+
"author": "Steven Velozo <steven@velozo.com> (http://velozo.com/)",
|
|
93
|
+
"license": "MIT",
|
|
94
|
+
"bugs": {
|
|
95
|
+
"url": "https://github.com/stevenvelozo/fable-serviceproviderbase/issues"
|
|
96
|
+
},
|
|
97
|
+
"homepage": "https://github.com/stevenvelozo/fable-serviceproviderbase",
|
|
98
|
+
"devDependencies": {
|
|
99
|
+
"fable": "^3.0.143",
|
|
100
|
+
"quackage": "^1.0.33"
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}, {}],
|
|
104
|
+
2: [function (require, module, exports) {
|
|
64
105
|
/**
|
|
65
106
|
* Fable Service Base
|
|
66
107
|
* @author <steven@velozo.com>
|
|
67
108
|
*/
|
|
109
|
+
|
|
110
|
+
var libPackage = require('../package.json');
|
|
68
111
|
var FableServiceProviderBase = /*#__PURE__*/function () {
|
|
69
112
|
// The constructor can be used in two ways:
|
|
70
113
|
// 1) With a fable, options object and service hash (the options object and service hash are optional)
|
|
@@ -78,6 +121,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
78
121
|
this.fable = false;
|
|
79
122
|
}
|
|
80
123
|
|
|
124
|
+
// Initialize the services map if it wasn't passed in
|
|
125
|
+
/** @type {Object} */
|
|
126
|
+
this._PackageFableServiceProvider = libPackage;
|
|
127
|
+
|
|
81
128
|
// initialize options and UUID based on whether the fable was passed in or not.
|
|
82
129
|
if (this.fable) {
|
|
83
130
|
this.UUID = pFable.getUUID();
|
|
@@ -124,8 +171,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
124
171
|
|
|
125
172
|
// This is left here in case we want to go back to having different code/base class for "core" services
|
|
126
173
|
module.exports.CoreServiceProviderBase = FableServiceProviderBase;
|
|
127
|
-
}, {
|
|
128
|
-
|
|
174
|
+
}, {
|
|
175
|
+
"../package.json": 1
|
|
176
|
+
}],
|
|
177
|
+
3: [function (require, module, exports) {
|
|
129
178
|
// When a boxed property is passed in, it should have quotes of some
|
|
130
179
|
// kind around it.
|
|
131
180
|
//
|
|
@@ -150,7 +199,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
150
199
|
};
|
|
151
200
|
module.exports = cleanWrapCharacters;
|
|
152
201
|
}, {}],
|
|
153
|
-
|
|
202
|
+
4: [function (require, module, exports) {
|
|
154
203
|
/**
|
|
155
204
|
* @author <steven@velozo.com>
|
|
156
205
|
*/
|
|
@@ -250,9 +299,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
250
299
|
}();
|
|
251
300
|
module.exports = ManyfestHashTranslation;
|
|
252
301
|
}, {
|
|
253
|
-
"./Manyfest-LogToConsole.js":
|
|
302
|
+
"./Manyfest-LogToConsole.js": 5
|
|
254
303
|
}],
|
|
255
|
-
|
|
304
|
+
5: [function (require, module, exports) {
|
|
256
305
|
/**
|
|
257
306
|
* @author <steven@velozo.com>
|
|
258
307
|
*/
|
|
@@ -268,7 +317,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
268
317
|
};
|
|
269
318
|
module.exports = logToConsole;
|
|
270
319
|
}, {}],
|
|
271
|
-
|
|
320
|
+
6: [function (require, module, exports) {
|
|
272
321
|
/**
|
|
273
322
|
* @author <steven@velozo.com>
|
|
274
323
|
*/
|
|
@@ -300,9 +349,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
300
349
|
* @class ManyfestObjectAddressResolverCheckAddressExists
|
|
301
350
|
*/
|
|
302
351
|
var ManyfestObjectAddressResolverCheckAddressExists = /*#__PURE__*/function () {
|
|
303
|
-
function ManyfestObjectAddressResolverCheckAddressExists() {
|
|
352
|
+
function ManyfestObjectAddressResolverCheckAddressExists(pInfoLog, pErrorLog) {
|
|
304
353
|
_classCallCheck(this, ManyfestObjectAddressResolverCheckAddressExists);
|
|
305
|
-
|
|
354
|
+
// Wire in logging
|
|
355
|
+
this.logInfo = typeof pInfoLog == 'function' ? pInfoLog : libSimpleLog;
|
|
356
|
+
this.logError = typeof pErrorLog == 'function' ? pErrorLog : libSimpleLog;
|
|
357
|
+
this.getObjectValueClass = new libGetObjectValue(this.logInfo, this.logError);
|
|
306
358
|
}
|
|
307
359
|
|
|
308
360
|
// Check if an address exists.
|
|
@@ -569,11 +621,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
569
621
|
;
|
|
570
622
|
module.exports = ManyfestObjectAddressResolverCheckAddressExists;
|
|
571
623
|
}, {
|
|
572
|
-
"./Manyfest-LogToConsole.js":
|
|
573
|
-
"./Manyfest-ObjectAddress-GetValue.js":
|
|
574
|
-
"./Manyfest-ObjectAddress-Parser.js":
|
|
624
|
+
"./Manyfest-LogToConsole.js": 5,
|
|
625
|
+
"./Manyfest-ObjectAddress-GetValue.js": 8,
|
|
626
|
+
"./Manyfest-ObjectAddress-Parser.js": 9
|
|
575
627
|
}],
|
|
576
|
-
|
|
628
|
+
7: [function (require, module, exports) {
|
|
577
629
|
/**
|
|
578
630
|
* @author <steven@velozo.com>
|
|
579
631
|
*/
|
|
@@ -884,11 +936,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
884
936
|
;
|
|
885
937
|
module.exports = ManyfestObjectAddressResolverDeleteValue;
|
|
886
938
|
}, {
|
|
887
|
-
"../source/Manyfest-ParseConditionals.js":
|
|
888
|
-
"./Manyfest-CleanWrapCharacters.js":
|
|
889
|
-
"./Manyfest-LogToConsole.js":
|
|
939
|
+
"../source/Manyfest-ParseConditionals.js": 12,
|
|
940
|
+
"./Manyfest-CleanWrapCharacters.js": 3,
|
|
941
|
+
"./Manyfest-LogToConsole.js": 5
|
|
890
942
|
}],
|
|
891
|
-
|
|
943
|
+
8: [function (require, module, exports) {
|
|
892
944
|
/**
|
|
893
945
|
* @author <steven@velozo.com>
|
|
894
946
|
*/
|
|
@@ -938,9 +990,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
938
990
|
key: "getValueAtAddress",
|
|
939
991
|
value: function getValueAtAddress(pObject, pAddress, pParentAddress, pRootObject) {
|
|
940
992
|
// Make sure pObject (the object we are meant to be recursing) is an object (which could be an array or object)
|
|
941
|
-
if (_typeof(pObject) != 'object')
|
|
993
|
+
if (_typeof(pObject) != 'object') {
|
|
994
|
+
return undefined;
|
|
995
|
+
}
|
|
996
|
+
if (pObject === null) {
|
|
997
|
+
return undefined;
|
|
998
|
+
}
|
|
942
999
|
// Make sure pAddress (the address we are resolving) is a string
|
|
943
|
-
if (typeof pAddress != 'string')
|
|
1000
|
+
if (typeof pAddress != 'string') {
|
|
1001
|
+
return undefined;
|
|
1002
|
+
}
|
|
944
1003
|
// Stash the parent address for later resolution
|
|
945
1004
|
var tmpParentAddress = "";
|
|
946
1005
|
if (typeof pParentAddress == 'string') {
|
|
@@ -1158,7 +1217,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1158
1217
|
if (_typeof(pObject[pAddress]) != null) {
|
|
1159
1218
|
return pObject[pAddress];
|
|
1160
1219
|
} else {
|
|
1161
|
-
return
|
|
1220
|
+
return null;
|
|
1162
1221
|
}
|
|
1163
1222
|
}
|
|
1164
1223
|
} else {
|
|
@@ -1387,12 +1446,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1387
1446
|
;
|
|
1388
1447
|
module.exports = ManyfestObjectAddressResolverGetValue;
|
|
1389
1448
|
}, {
|
|
1390
|
-
"../source/Manyfest-ParseConditionals.js":
|
|
1391
|
-
"./Manyfest-CleanWrapCharacters.js":
|
|
1392
|
-
"./Manyfest-LogToConsole.js":
|
|
1393
|
-
"./Manyfest-ObjectAddress-Parser.js":
|
|
1449
|
+
"../source/Manyfest-ParseConditionals.js": 12,
|
|
1450
|
+
"./Manyfest-CleanWrapCharacters.js": 3,
|
|
1451
|
+
"./Manyfest-LogToConsole.js": 5,
|
|
1452
|
+
"./Manyfest-ObjectAddress-Parser.js": 9
|
|
1394
1453
|
}],
|
|
1395
|
-
|
|
1454
|
+
9: [function (require, module, exports) {
|
|
1396
1455
|
// TODO: This is an inelegant solution to delay the rewrite of Manyfest.
|
|
1397
1456
|
|
|
1398
1457
|
// Fable 3.0 has a service for data formatting that deals well with nested enclosures.
|
|
@@ -1646,7 +1705,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1646
1705
|
}
|
|
1647
1706
|
};
|
|
1648
1707
|
}, {}],
|
|
1649
|
-
|
|
1708
|
+
10: [function (require, module, exports) {
|
|
1650
1709
|
/**
|
|
1651
1710
|
* @author <steven@velozo.com>
|
|
1652
1711
|
*/
|
|
@@ -1710,17 +1769,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1710
1769
|
// The "Name" of the Object contained too the left of the bracket
|
|
1711
1770
|
var tmpBoxedPropertyName = pAddress.substring(0, tmpBracketStartIndex).trim();
|
|
1712
1771
|
|
|
1772
|
+
// The "Reference" to the property within it, either an array element or object property
|
|
1773
|
+
var tmpBoxedPropertyReference = pAddress.substring(tmpBracketStartIndex + 1, tmpBracketStopIndex).trim();
|
|
1774
|
+
// Attempt to parse the reference as a number, which will be used as an array element
|
|
1775
|
+
var tmpBoxedPropertyNumber = parseInt(tmpBoxedPropertyReference, 10);
|
|
1776
|
+
var tmpIndexIsNumeric = !isNaN(tmpBoxedPropertyNumber);
|
|
1777
|
+
if (pObject[tmpBoxedPropertyName] == null) {
|
|
1778
|
+
if (tmpIndexIsNumeric) {
|
|
1779
|
+
pObject[tmpBoxedPropertyName] = [];
|
|
1780
|
+
} else {
|
|
1781
|
+
pObject[tmpBoxedPropertyName] = {};
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1713
1785
|
// If the subproperty doesn't test as a proper Object, none of the rest of this is possible.
|
|
1714
1786
|
// This is a rare case where Arrays testing as Objects is useful
|
|
1715
1787
|
if (_typeof(pObject[tmpBoxedPropertyName]) !== 'object') {
|
|
1716
1788
|
return false;
|
|
1717
1789
|
}
|
|
1718
1790
|
|
|
1719
|
-
// The "Reference" to the property within it, either an array element or object property
|
|
1720
|
-
var tmpBoxedPropertyReference = pAddress.substring(tmpBracketStartIndex + 1, tmpBracketStopIndex).trim();
|
|
1721
|
-
// Attempt to parse the reference as a number, which will be used as an array element
|
|
1722
|
-
var tmpBoxedPropertyNumber = parseInt(tmpBoxedPropertyReference, 10);
|
|
1723
|
-
|
|
1724
1791
|
// Guard: If the referrant is a number and the boxed property is not an array, or vice versa, return undefined.
|
|
1725
1792
|
// This seems confusing to me at first read, so explaination:
|
|
1726
1793
|
// Is the Boxed Object an Array? TRUE
|
|
@@ -1738,11 +1805,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1738
1805
|
tmpBoxedPropertyReference = this.cleanWrapCharacters('"', tmpBoxedPropertyReference);
|
|
1739
1806
|
tmpBoxedPropertyReference = this.cleanWrapCharacters('`', tmpBoxedPropertyReference);
|
|
1740
1807
|
tmpBoxedPropertyReference = this.cleanWrapCharacters("'", tmpBoxedPropertyReference);
|
|
1808
|
+
if (!(tmpBoxedPropertyReference in pObject[tmpBoxedPropertyName])) {
|
|
1809
|
+
// If the subobject doesn't exist, create it
|
|
1810
|
+
pObject[tmpBoxedPropertyName][tmpBoxedPropertyReference] = {};
|
|
1811
|
+
}
|
|
1741
1812
|
|
|
1742
1813
|
// Return the value in the property
|
|
1814
|
+
//TODO: For cases where we have chained [][] properties, this needs to recurse somehow
|
|
1743
1815
|
pObject[tmpBoxedPropertyName][tmpBoxedPropertyReference] = pValue;
|
|
1744
1816
|
return true;
|
|
1745
1817
|
} else {
|
|
1818
|
+
while (pObject[tmpBoxedPropertyName].length < tmpBoxedPropertyNumber + 1) {
|
|
1819
|
+
// If the subobject doesn't exist, create it
|
|
1820
|
+
pObject[tmpBoxedPropertyName].push({});
|
|
1821
|
+
}
|
|
1746
1822
|
pObject[tmpBoxedPropertyName][tmpBoxedPropertyNumber] = pValue;
|
|
1747
1823
|
return true;
|
|
1748
1824
|
}
|
|
@@ -1776,6 +1852,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1776
1852
|
var _tmpBoxedPropertyName8 = tmpSubObjectName.substring(0, _tmpBracketStartIndex4).trim();
|
|
1777
1853
|
var _tmpBoxedPropertyReference4 = tmpSubObjectName.substring(_tmpBracketStartIndex4 + 1, _tmpBracketStopIndex4).trim();
|
|
1778
1854
|
var _tmpBoxedPropertyNumber4 = parseInt(_tmpBoxedPropertyReference4, 10);
|
|
1855
|
+
var _tmpIndexIsNumeric = !isNaN(_tmpBoxedPropertyNumber4);
|
|
1856
|
+
|
|
1857
|
+
//if (typeof(pObject[tmpBoxedPropertyName]) !== 'object')
|
|
1858
|
+
if (pObject[_tmpBoxedPropertyName8] == null) {
|
|
1859
|
+
if (_tmpIndexIsNumeric) {
|
|
1860
|
+
pObject[_tmpBoxedPropertyName8] = [];
|
|
1861
|
+
} else {
|
|
1862
|
+
pObject[_tmpBoxedPropertyName8] = {};
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1779
1865
|
|
|
1780
1866
|
// Guard: If the referrant is a number and the boxed property is not an array, or vice versa, return undefined.
|
|
1781
1867
|
// This seems confusing to me at first read, so explaination:
|
|
@@ -1791,7 +1877,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1791
1877
|
// BUT
|
|
1792
1878
|
// StudentData.Sections.Algebra.Students is an array, so the ["JaneDoe"].Grade is not possible to access
|
|
1793
1879
|
// TODO: Should this be an error or something? Should we keep a log of failures like this?
|
|
1794
|
-
if (Array.isArray(pObject[_tmpBoxedPropertyName8])
|
|
1880
|
+
if (Array.isArray(pObject[_tmpBoxedPropertyName8]) != _tmpIndexIsNumeric) {
|
|
1795
1881
|
return false;
|
|
1796
1882
|
}
|
|
1797
1883
|
|
|
@@ -1803,10 +1889,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1803
1889
|
_tmpBoxedPropertyReference4 = this.cleanWrapCharacters('"', _tmpBoxedPropertyReference4);
|
|
1804
1890
|
_tmpBoxedPropertyReference4 = this.cleanWrapCharacters('`', _tmpBoxedPropertyReference4);
|
|
1805
1891
|
_tmpBoxedPropertyReference4 = this.cleanWrapCharacters("'", _tmpBoxedPropertyReference4);
|
|
1892
|
+
if (!(_tmpBoxedPropertyReference4 in pObject[_tmpBoxedPropertyName8])) {
|
|
1893
|
+
// If the subobject doesn't exist, create it
|
|
1894
|
+
pObject[_tmpBoxedPropertyName8][_tmpBoxedPropertyReference4] = {};
|
|
1895
|
+
}
|
|
1806
1896
|
|
|
1807
1897
|
// Recurse directly into the subobject
|
|
1808
1898
|
return this.setValueAtAddress(pObject[_tmpBoxedPropertyName8][_tmpBoxedPropertyReference4], tmpNewAddress, pValue);
|
|
1809
1899
|
} else {
|
|
1900
|
+
while (pObject[_tmpBoxedPropertyName8].length < _tmpBoxedPropertyNumber4 + 1) {
|
|
1901
|
+
// If the subobject doesn't exist, create it
|
|
1902
|
+
pObject[_tmpBoxedPropertyName8].push({});
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1810
1905
|
// We parsed a valid number out of the boxed property name, so recurse into the array
|
|
1811
1906
|
return this.setValueAtAddress(pObject[_tmpBoxedPropertyName8][_tmpBoxedPropertyNumber4], tmpNewAddress, pValue);
|
|
1812
1907
|
}
|
|
@@ -1834,10 +1929,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1834
1929
|
;
|
|
1835
1930
|
module.exports = ManyfestObjectAddressSetValue;
|
|
1836
1931
|
}, {
|
|
1837
|
-
"./Manyfest-CleanWrapCharacters.js":
|
|
1838
|
-
"./Manyfest-LogToConsole.js":
|
|
1932
|
+
"./Manyfest-CleanWrapCharacters.js": 3,
|
|
1933
|
+
"./Manyfest-LogToConsole.js": 5
|
|
1839
1934
|
}],
|
|
1840
|
-
|
|
1935
|
+
11: [function (require, module, exports) {
|
|
1841
1936
|
/**
|
|
1842
1937
|
* @author <steven@velozo.com>
|
|
1843
1938
|
*/
|
|
@@ -1949,9 +2044,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
1949
2044
|
;
|
|
1950
2045
|
module.exports = ManyfestObjectAddressGeneration;
|
|
1951
2046
|
}, {
|
|
1952
|
-
"./Manyfest-LogToConsole.js":
|
|
2047
|
+
"./Manyfest-LogToConsole.js": 5
|
|
1953
2048
|
}],
|
|
1954
|
-
|
|
2049
|
+
12: [function (require, module, exports) {
|
|
1955
2050
|
// Given a string, parse out any conditional expressions and set whether or not to keep the record.
|
|
1956
2051
|
//
|
|
1957
2052
|
// For instance:
|
|
@@ -2085,7 +2180,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2085
2180
|
};
|
|
2086
2181
|
module.exports = parseConditionals;
|
|
2087
2182
|
}, {}],
|
|
2088
|
-
|
|
2183
|
+
13: [function (require, module, exports) {
|
|
2089
2184
|
/**
|
|
2090
2185
|
* @author <steven@velozo.com>
|
|
2091
2186
|
*/
|
|
@@ -2202,9 +2297,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2202
2297
|
}();
|
|
2203
2298
|
module.exports = ManyfestSchemaManipulation;
|
|
2204
2299
|
}, {
|
|
2205
|
-
"./Manyfest-LogToConsole.js":
|
|
2300
|
+
"./Manyfest-LogToConsole.js": 5
|
|
2206
2301
|
}],
|
|
2207
|
-
|
|
2302
|
+
14: [function (require, module, exports) {
|
|
2208
2303
|
/**
|
|
2209
2304
|
* @author <steven@velozo.com>
|
|
2210
2305
|
*/
|
|
@@ -2222,6 +2317,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2222
2317
|
Descriptors: {}
|
|
2223
2318
|
};
|
|
2224
2319
|
|
|
2320
|
+
/**
|
|
2321
|
+
* @typedef {{
|
|
2322
|
+
* Hash?: string,
|
|
2323
|
+
* Name?: string,
|
|
2324
|
+
* DataType?: string,
|
|
2325
|
+
* Required?: boolean,
|
|
2326
|
+
* Address?: string,
|
|
2327
|
+
* Description?: string,
|
|
2328
|
+
* [key: string]: any,
|
|
2329
|
+
* }} ManifestDescriptor
|
|
2330
|
+
*/
|
|
2331
|
+
|
|
2225
2332
|
/**
|
|
2226
2333
|
* Manyfest object address-based descriptions and manipulations.
|
|
2227
2334
|
*
|
|
@@ -2236,6 +2343,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2236
2343
|
} else {
|
|
2237
2344
|
_this3 = _callSuper(this, Manyfest, [pFable, pManifest, pServiceHash]);
|
|
2238
2345
|
}
|
|
2346
|
+
|
|
2347
|
+
/** @type {Record<string, any>} */
|
|
2348
|
+
_this3.options;
|
|
2239
2349
|
_this3.serviceType = 'Manifest';
|
|
2240
2350
|
|
|
2241
2351
|
// Wire in logging
|
|
@@ -2351,7 +2461,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2351
2461
|
}
|
|
2352
2462
|
if ('HashTranslations' in tmpManifest) {
|
|
2353
2463
|
if (_typeof(tmpManifest.HashTranslations) === 'object') {
|
|
2354
|
-
for (var
|
|
2464
|
+
for (var _i0 = 0; _i0 < tmpManifest.HashTranslations.length; _i0++) {
|
|
2355
2465
|
// Each translation is
|
|
2356
2466
|
}
|
|
2357
2467
|
}
|
|
@@ -2374,7 +2484,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2374
2484
|
};
|
|
2375
2485
|
}
|
|
2376
2486
|
|
|
2377
|
-
|
|
2487
|
+
/**
|
|
2488
|
+
* Add a descriptor to the manifest
|
|
2489
|
+
*
|
|
2490
|
+
* @param {string} pAddress - The address of the element to add the descriptor for.
|
|
2491
|
+
* @param {ManifestDescriptor} pDescriptor - The descriptor object to add.
|
|
2492
|
+
*/
|
|
2378
2493
|
}, {
|
|
2379
2494
|
key: "addDescriptor",
|
|
2380
2495
|
value: function addDescriptor(pAddress, pDescriptor) {
|
|
@@ -2405,18 +2520,33 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2405
2520
|
return false;
|
|
2406
2521
|
}
|
|
2407
2522
|
}
|
|
2523
|
+
|
|
2524
|
+
/**
|
|
2525
|
+
* @param {string} pHash - The hash of the address to resolve.
|
|
2526
|
+
*
|
|
2527
|
+
* @return {ManifestDescriptor} The descriptor for the address
|
|
2528
|
+
*/
|
|
2408
2529
|
}, {
|
|
2409
2530
|
key: "getDescriptorByHash",
|
|
2410
2531
|
value: function getDescriptorByHash(pHash) {
|
|
2411
2532
|
return this.getDescriptor(this.resolveHashAddress(pHash));
|
|
2412
2533
|
}
|
|
2534
|
+
|
|
2535
|
+
/**
|
|
2536
|
+
* @param {string} pAddress - The address of the element to get the descriptor for.
|
|
2537
|
+
*
|
|
2538
|
+
* @return {ManifestDescriptor} The descriptor for the address
|
|
2539
|
+
*/
|
|
2413
2540
|
}, {
|
|
2414
2541
|
key: "getDescriptor",
|
|
2415
2542
|
value: function getDescriptor(pAddress) {
|
|
2416
2543
|
return this.elementDescriptors[pAddress];
|
|
2417
2544
|
}
|
|
2418
2545
|
|
|
2419
|
-
|
|
2546
|
+
/**
|
|
2547
|
+
* execute an action function for each descriptor
|
|
2548
|
+
* @param {(d: ManifestDescriptor) => void} fAction - The action function to execute for each descriptor.
|
|
2549
|
+
*/
|
|
2420
2550
|
}, {
|
|
2421
2551
|
key: "eachDescriptor",
|
|
2422
2552
|
value: function eachDescriptor(fAction) {
|
|
@@ -2448,8 +2578,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2448
2578
|
key: "resolveHashAddress",
|
|
2449
2579
|
value: function resolveHashAddress(pHash) {
|
|
2450
2580
|
var tmpAddress = undefined;
|
|
2451
|
-
var tmpInElementHashTable =
|
|
2452
|
-
var tmpInTranslationTable =
|
|
2581
|
+
var tmpInElementHashTable = pHash in this.elementHashes;
|
|
2582
|
+
var tmpInTranslationTable = pHash in this.hashTranslations.translationTable;
|
|
2453
2583
|
|
|
2454
2584
|
// The most straightforward: the hash exists, no translations.
|
|
2455
2585
|
if (tmpInElementHashTable && !tmpInTranslationTable) {
|
|
@@ -2482,20 +2612,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2482
2612
|
}
|
|
2483
2613
|
return tmpValue;
|
|
2484
2614
|
}
|
|
2615
|
+
}, {
|
|
2616
|
+
key: "lintAddress",
|
|
2617
|
+
value: function lintAddress(pAddress) {
|
|
2618
|
+
var tmpLintedAddress = pAddress.trim();
|
|
2619
|
+
// Check for a single . (but not a ..) at the end of the address and remove it.
|
|
2620
|
+
if (tmpLintedAddress.endsWith('..')) {
|
|
2621
|
+
tmpLintedAddress = tmpLintedAddress.slice(0, -1);
|
|
2622
|
+
} else if (tmpLintedAddress.endsWith('.')) {
|
|
2623
|
+
tmpLintedAddress = tmpLintedAddress.slice(0, -1);
|
|
2624
|
+
}
|
|
2625
|
+
return tmpLintedAddress;
|
|
2626
|
+
}
|
|
2485
2627
|
|
|
2486
2628
|
// Get the value of an element at an address
|
|
2487
2629
|
}, {
|
|
2488
2630
|
key: "getValueAtAddress",
|
|
2489
2631
|
value: function getValueAtAddress(pObject, pAddress) {
|
|
2490
|
-
var tmpLintedAddress =
|
|
2632
|
+
var tmpLintedAddress = this.lintAddress(pAddress);
|
|
2491
2633
|
if (tmpLintedAddress == '') {
|
|
2492
2634
|
this.logError("(".concat(this.scope, ") Error getting value at address; address is an empty string."), pObject);
|
|
2493
2635
|
return undefined;
|
|
2494
2636
|
}
|
|
2495
|
-
var tmpValue = this.objectAddressGetValue.getValueAtAddress(pObject,
|
|
2637
|
+
var tmpValue = this.objectAddressGetValue.getValueAtAddress(pObject, tmpLintedAddress);
|
|
2496
2638
|
if (typeof tmpValue == 'undefined') {
|
|
2497
2639
|
// Try to get a default if it exists
|
|
2498
|
-
tmpValue = this.getDefaultValue(this.getDescriptor(
|
|
2640
|
+
tmpValue = this.getDefaultValue(this.getDescriptor(tmpLintedAddress));
|
|
2499
2641
|
}
|
|
2500
2642
|
return tmpValue;
|
|
2501
2643
|
}
|
|
@@ -2511,7 +2653,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2511
2653
|
}, {
|
|
2512
2654
|
key: "setValueAtAddress",
|
|
2513
2655
|
value: function setValueAtAddress(pObject, pAddress, pValue) {
|
|
2514
|
-
|
|
2656
|
+
var tmpLintedAddress = this.lintAddress(pAddress);
|
|
2657
|
+
return this.objectAddressSetValue.setValueAtAddress(pObject, tmpLintedAddress, pValue);
|
|
2515
2658
|
}
|
|
2516
2659
|
|
|
2517
2660
|
// Delete the value of an element by its hash
|
|
@@ -2525,7 +2668,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2525
2668
|
}, {
|
|
2526
2669
|
key: "deleteValueAtAddress",
|
|
2527
2670
|
value: function deleteValueAtAddress(pObject, pAddress, pValue) {
|
|
2528
|
-
|
|
2671
|
+
var tmpLintedAddress = this.lintAddress(pAddress);
|
|
2672
|
+
return this.objectAddressDeleteValue.deleteValueAtAddress(pObject, tmpLintedAddress, pValue);
|
|
2529
2673
|
}
|
|
2530
2674
|
|
|
2531
2675
|
// Validate the consistency of an object against the schema
|
|
@@ -2615,7 +2759,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2615
2759
|
return tmpValidationData;
|
|
2616
2760
|
}
|
|
2617
2761
|
|
|
2618
|
-
|
|
2762
|
+
/**
|
|
2763
|
+
* Returns a default value, or, the default value for the data type (which is overridable with configuration)
|
|
2764
|
+
*
|
|
2765
|
+
* @param {ManifestDescriptor} pDescriptor - The descriptor definition.
|
|
2766
|
+
*/
|
|
2619
2767
|
}, {
|
|
2620
2768
|
key: "getDefaultValue",
|
|
2621
2769
|
value: function getDefaultValue(pDescriptor) {
|
|
@@ -2680,15 +2828,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2680
2828
|
;
|
|
2681
2829
|
module.exports = Manyfest;
|
|
2682
2830
|
}, {
|
|
2683
|
-
"./Manyfest-HashTranslation.js":
|
|
2684
|
-
"./Manyfest-LogToConsole.js":
|
|
2685
|
-
"./Manyfest-ObjectAddress-CheckAddressExists.js":
|
|
2686
|
-
"./Manyfest-ObjectAddress-DeleteValue.js":
|
|
2687
|
-
"./Manyfest-ObjectAddress-GetValue.js":
|
|
2688
|
-
"./Manyfest-ObjectAddress-SetValue.js":
|
|
2689
|
-
"./Manyfest-ObjectAddressGeneration.js":
|
|
2690
|
-
"./Manyfest-SchemaManipulation.js":
|
|
2691
|
-
"fable-serviceproviderbase":
|
|
2831
|
+
"./Manyfest-HashTranslation.js": 4,
|
|
2832
|
+
"./Manyfest-LogToConsole.js": 5,
|
|
2833
|
+
"./Manyfest-ObjectAddress-CheckAddressExists.js": 6,
|
|
2834
|
+
"./Manyfest-ObjectAddress-DeleteValue.js": 7,
|
|
2835
|
+
"./Manyfest-ObjectAddress-GetValue.js": 8,
|
|
2836
|
+
"./Manyfest-ObjectAddress-SetValue.js": 10,
|
|
2837
|
+
"./Manyfest-ObjectAddressGeneration.js": 11,
|
|
2838
|
+
"./Manyfest-SchemaManipulation.js": 13,
|
|
2839
|
+
"fable-serviceproviderbase": 2
|
|
2692
2840
|
}]
|
|
2693
|
-
}, {}, [
|
|
2694
|
-
});
|
|
2841
|
+
}, {}, [14])(14);
|
|
2842
|
+
});
|
|
2843
|
+
//# sourceMappingURL=manyfest.compatible.js.map
|