fable 3.1.4 → 3.1.7
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/debug/Harness.js +12 -12
- package/dist/fable.js +69 -7
- package/dist/fable.js.map +1 -1
- package/dist/fable.min.js +2 -2
- package/dist/fable.min.js.map +1 -1
- package/example_applications/mathematical_playground/Math-Solver-Harness.js +27 -23
- package/package.json +67 -67
- package/source/services/Fable-Service-DataFormat.js +134 -1
- package/source/services/Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ExpressionTokenizer.js +28 -2
- package/source/services/Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json +31 -1
- package/source/services/Fable-Service-Utility.js +50 -0
- package/test/DataFormat-StringNumberFormatting_tests.js +67 -0
- package/test/ExpressionParser_tests.js +45 -1
package/debug/Harness.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const libFable = require('../source/Fable.js');
|
|
1
|
+
// const libFable = require('../source/Fable.js');
|
|
2
2
|
|
|
3
|
-
const _Fable = new libFable({"Product": "Harness"});
|
|
3
|
+
// const _Fable = new libFable({"Product": "Harness"});
|
|
4
4
|
|
|
5
|
-
let tmpValue;
|
|
5
|
+
// let tmpValue;
|
|
6
6
|
|
|
7
|
-
tmpValue = _Fable.Dates.dateDayDifference("2023-10-01", "2023-09-01");
|
|
8
|
-
console.log(`Difference in days: ${tmpValue}`);
|
|
7
|
+
// tmpValue = _Fable.Dates.dateDayDifference("2023-10-01", "2023-09-01");
|
|
8
|
+
// console.log(`Difference in days: ${tmpValue}`);
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
tmpValue = _Fable.Dates.dateWeekDifference("2023-10-01", "2023-09-01");
|
|
12
|
-
console.log(`Difference in weeks: ${tmpValue}`);
|
|
11
|
+
// tmpValue = _Fable.Dates.dateWeekDifference("2023-10-01", "2023-09-01");
|
|
12
|
+
// console.log(`Difference in weeks: ${tmpValue}`);
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
tmpValue = _Fable.Dates.dateMonthDifference("2016-10-01", "2023-09-01");
|
|
16
|
-
console.log(`Difference in months: ${tmpValue}`);
|
|
15
|
+
// tmpValue = _Fable.Dates.dateMonthDifference("2016-10-01", "2023-09-01");
|
|
16
|
+
// console.log(`Difference in months: ${tmpValue}`);
|
|
17
17
|
|
|
18
|
-
tmpValue = _Fable.Dates.dateYearDifference("1963-10-01", "2023-09-01");
|
|
19
|
-
console.log(`Difference in years: ${tmpValue}`);
|
|
18
|
+
// tmpValue = _Fable.Dates.dateYearDifference("1963-10-01", "2023-09-01");
|
|
19
|
+
// console.log(`Difference in years: ${tmpValue}`);
|
|
20
20
|
|
|
21
21
|
// const _ExpressionParser = _Fable.instantiateServiceProviderIfNotExists('ExpressionParser');
|
|
22
22
|
|
|
@@ -49,4 +49,4 @@ console.log(`Difference in years: ${tmpValue}`);
|
|
|
49
49
|
// }
|
|
50
50
|
// console.log(`Result: ${tmpResult}`);
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const libMathHarness = require('../example_applications/mathematical_playground/Math-Solver-Harness.js');
|
package/dist/fable.js
CHANGED
|
@@ -3012,7 +3012,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
3012
3012
|
// presumably different callback function.
|
|
3013
3013
|
// This makes sure that own properties are retained, so that
|
|
3014
3014
|
// decorations and such are not lost along the way.
|
|
3015
|
-
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],130:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],131:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.
|
|
3015
|
+
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],130:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],131:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.7","description":"A service dependency injection, configuration and logging library.","main":"source/Fable.js","scripts":{"start":"node source/Fable.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","test":"./node_modules/.bin/mocha -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t fable-image:local","docker-dev-run":"docker run -it -d --name fable-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" fable-image:local","docker-dev-shell":"docker exec -it fable-dev /bin/bash","tests":"./node_modules/mocha/bin/_mocha -u tdd --exit -R spec --grep"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"browser":{"./source/service/Fable-Service-EnvironmentData.js":"./source/service/Fable-Service-EnvironmentData-Web.js","./source/service/Fable-Service-FilePersistence.js":"./source/service/Fable-Service-FilePersistence-Web.js"},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable.git"},"keywords":["entity","behavior"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable/issues"},"homepage":"https://github.com/stevenvelozo/fable","devDependencies":{"quackage":"^1.0.41"},"dependencies":{"async.eachlimit":"^0.5.2","async.waterfall":"^0.5.2","big.js":"^6.2.2","cachetrax":"^1.0.4","cookie":"^0.6.0","data-arithmatic":"^1.0.7","dayjs":"^1.11.13","fable-log":"^3.0.16","fable-serviceproviderbase":"^3.0.15","fable-settings":"^3.0.12","fable-uuid":"^3.0.11","manyfest":"^1.0.38","simple-get":"^4.0.1"}};},{}],132:[function(require,module,exports){/**
|
|
3016
3016
|
* Fable Application Services Support Library
|
|
3017
3017
|
* @author <steven@velozo.com>
|
|
3018
3018
|
*/ // Pre-init services
|
|
@@ -3174,6 +3174,50 @@ if(!(pEndIndex<this.length)){pEndIndex=this.length;}else{pEndIndex|=0;// round p
|
|
|
3174
3174
|
* @param {string} pString
|
|
3175
3175
|
* @returns {string}
|
|
3176
3176
|
*/insecureStringHash(pString){let tmpHash=0;let tmpStringLength=pString.length;let tmpCharacterIndex=0;while(tmpCharacterIndex<tmpStringLength){tmpHash=(tmpHash<<5)-tmpHash+pString.charCodeAt(tmpCharacterIndex++)|0;}return`${this._Value_Prefix_StringHash}${tmpHash}`;}capitalizeEachWord(pString){return pString.replace(this._Regex_formatterCapitalizeEachWord,pMatch=>{return pMatch.charAt(0).toUpperCase()+pMatch.substr(1);});}/**
|
|
3177
|
+
* Concatenate a list of strings together. Non-strings are excluded.
|
|
3178
|
+
*
|
|
3179
|
+
* @param {...string} pStrings - The strings to concatenate
|
|
3180
|
+
* @return {string}
|
|
3181
|
+
*/concatenateStrings(){for(var _len2=arguments.length,pStrings=new Array(_len2),_key2=0;_key2<_len2;_key2++){pStrings[_key2]=arguments[_key2];}return this.joinStrings('',...pStrings);}/**
|
|
3182
|
+
* Concatenate a list of strings together. Non-strings are excluded.
|
|
3183
|
+
*
|
|
3184
|
+
* @param {string} pValueObjectSetAddress - The address of the array of strings to concatenate
|
|
3185
|
+
* @return {string}
|
|
3186
|
+
*/concatenateStringsInternal(pValueObjectSetAddress){if(!pValueObjectSetAddress){return{};}let tmpValueObjectSet=this.fable.Utility.getInternalValueByHash(pValueObjectSetAddress);if(!Array.isArray(tmpValueObjectSet)){return tmpValueObjectSet||null;}return this.concatenateStrings(...tmpValueObjectSet);}/**
|
|
3187
|
+
* Join a list of strings together. Non-strings are excluded.
|
|
3188
|
+
*
|
|
3189
|
+
* @param {string} pJoin - The string to join with
|
|
3190
|
+
* @param {...string} pStrings - The strings to join
|
|
3191
|
+
* @return {string}
|
|
3192
|
+
*/joinStrings(pJoin){for(var _len3=arguments.length,pStrings=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){pStrings[_key3-1]=arguments[_key3];}return pStrings.filter(v=>typeof v==='string'||typeof v==='number').join(pJoin);}/**
|
|
3193
|
+
* Joins a list of strings together. Non-strings are excluded.
|
|
3194
|
+
*
|
|
3195
|
+
* @param {string} pJoin - The string to join with
|
|
3196
|
+
* @param {string} pValueObjectSetAddress - The address of the array of values to join
|
|
3197
|
+
* @return {string}
|
|
3198
|
+
*/joinStringsInternal(pJoin,pValueObjectSetAddress){if(!pValueObjectSetAddress){return{};}let tmpValueObjectSet=this.fable.Utility.getInternalValueByHash(pValueObjectSetAddress);if(!Array.isArray(tmpValueObjectSet)){return tmpValueObjectSet||null;}return this.joinStrings(pJoin,...tmpValueObjectSet);}/**
|
|
3199
|
+
* Concatenate a list of values together into a string.
|
|
3200
|
+
*
|
|
3201
|
+
* @param {...any} pValues - The strings to concatenate
|
|
3202
|
+
* @return {string}
|
|
3203
|
+
*/concatenateStringsRaw(){for(var _len4=arguments.length,pValues=new Array(_len4),_key4=0;_key4<_len4;_key4++){pValues[_key4]=arguments[_key4];}return this.joinStringsRaw('',...pValues);}/**
|
|
3204
|
+
* Concatenate a list of values together into a string.
|
|
3205
|
+
*
|
|
3206
|
+
* @param {string} pValueObjectSetAddress - The address of the array of values to concatenate
|
|
3207
|
+
* @return {string}
|
|
3208
|
+
*/concatenateStringsRawInternal(pValueObjectSetAddress){if(!pValueObjectSetAddress){return{};}let tmpValueObjectSet=this.fable.Utility.getInternalValueByHash(pValueObjectSetAddress);if(!Array.isArray(tmpValueObjectSet)){return tmpValueObjectSet||null;}return this.concatenateStringsRaw(...tmpValueObjectSet);}/**
|
|
3209
|
+
* Join a list of values together into a string.
|
|
3210
|
+
*
|
|
3211
|
+
* @param {string} pJoin - The string to join with
|
|
3212
|
+
* @param {...any} pValues - The strings to join
|
|
3213
|
+
* @return {string}
|
|
3214
|
+
*/joinStringsRaw(pJoin){for(var _len5=arguments.length,pValues=new Array(_len5>1?_len5-1:0),_key5=1;_key5<_len5;_key5++){pValues[_key5-1]=arguments[_key5];}return pValues.map(String).join(pJoin);}/**
|
|
3215
|
+
* Joins a list of values together into a string.
|
|
3216
|
+
*
|
|
3217
|
+
* @param {string} pJoin - The string to join with
|
|
3218
|
+
* @param {string} pValueObjectSetAddress - The address of the array of values to join
|
|
3219
|
+
* @return {string}
|
|
3220
|
+
*/joinStringsRawInternal(pJoin,pValueObjectSetAddress){if(!pValueObjectSetAddress){return{};}let tmpValueObjectSet=this.fable.Utility.getInternalValueByHash(pValueObjectSetAddress);if(!Array.isArray(tmpValueObjectSet)){return tmpValueObjectSet||null;}return this.joinStringsRaw(pJoin,...tmpValueObjectSet);}/**
|
|
3177
3221
|
* Clean wrapping characters if they exist consistently around the string. If they do not, the string is returned unchanged.
|
|
3178
3222
|
*
|
|
3179
3223
|
* @param {string} pWrapCharacter - The character expected as the wrapping character
|
|
@@ -3560,15 +3604,17 @@ return this.solvePostfixedExpression(tmpResultsObject.PostfixSolveList,tmpDataDe
|
|
|
3560
3604
|
* - Token
|
|
3561
3605
|
* : could be an operator e.g. "+", "-", "*", "/"
|
|
3562
3606
|
* : could be a parenthesis e.g. "(", ")"
|
|
3607
|
+
* - String
|
|
3608
|
+
* : Wrapped in double quotes e.g. "Hello World", "This is a test", etc.
|
|
3563
3609
|
*/let tmpCurrentTokenType=false;let tmpCurrentToken='';for(let i=0;i<pExpression.length;i++){let tmpCharacter=pExpression[i];// [ WHITESPACE ]
|
|
3564
3610
|
// 1. Space breaks tokens except when we're in an address that's been scoped by a {}
|
|
3565
|
-
if(tmpCharacter===' '&&tmpCurrentTokenType!=='StateAddress'){if(tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}tmpCurrentToken='';tmpCurrentTokenType=false;continue;}// [ STATE ADDRESS BLOCKS ]
|
|
3611
|
+
if(tmpCharacter===' '&&tmpCurrentTokenType!=='StateAddress'&&tmpCurrentTokenType!=='String'){if(tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}tmpCurrentToken='';tmpCurrentTokenType=false;continue;}// [ STATE ADDRESS AND STRING BLOCKS ]
|
|
3566
3612
|
// 2. If we're in an address, we keep going until we hit the closing brace
|
|
3567
|
-
if(tmpCurrentTokenType==='StateAddress'&&tmpCharacter!=='}'){tmpCurrentToken+=tmpCharacter;continue;}// 3. If we're in an address and we hit the closing brace, we close the token, push it and reset
|
|
3568
|
-
if(tmpCurrentTokenType==='StateAddress'&&tmpCharacter==='}'){tmpCurrentToken+=tmpCharacter;tmpResults.RawTokens.push(tmpCurrentToken);tmpCurrentToken='';tmpCurrentTokenType=false;continue;}// 4. If we're not in an address and we hit a closing brace it's a problem
|
|
3613
|
+
if(tmpCurrentTokenType==='StateAddress'&&tmpCharacter!=='}'){tmpCurrentToken+=tmpCharacter;continue;}if(tmpCurrentTokenType==='String'&&tmpCharacter!=='"'){tmpCurrentToken+=tmpCharacter;continue;}// 3. If we're in an address and we hit the closing brace, we close the token, push it and reset
|
|
3614
|
+
if(tmpCurrentTokenType==='StateAddress'&&tmpCharacter==='}'){tmpCurrentToken+=tmpCharacter;tmpResults.RawTokens.push(tmpCurrentToken);tmpCurrentToken='';tmpCurrentTokenType=false;continue;}if(tmpCurrentTokenType==='String'&&tmpCharacter==='"'){tmpCurrentToken+=tmpCharacter;tmpResults.RawTokens.push(tmpCurrentToken);tmpCurrentToken='';tmpCurrentTokenType=false;continue;}// 4. If we're not in an address and we hit a closing brace it's a problem
|
|
3569
3615
|
// TODO: Should we just ignore it? We do at the moment.
|
|
3570
3616
|
if(tmpCharacter=='}'){if(tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}tmpCurrentToken='';tmpCurrentTokenType=false;tmpResults.ExpressionParserLog.push(`ExpressionParser.tokenize found a closing brace without an opening brace in the expression: ${pExpression} at character index ${i}`);this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);continue;}// 5. If we're not in an address and we hit an opening brace, we start an address
|
|
3571
|
-
if(tmpCharacter=='{'){if(tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}tmpCurrentToken='';tmpCurrentTokenType='StateAddress';tmpCurrentToken=tmpCharacter;continue;}// [ TOKENS ]
|
|
3617
|
+
if(tmpCharacter=='{'){if(tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}tmpCurrentToken='';tmpCurrentTokenType='StateAddress';tmpCurrentToken=tmpCharacter;continue;}if(tmpCurrentTokenType!=='String'&&tmpCharacter=='"'){if(tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}tmpCurrentToken='';tmpCurrentTokenType='String';tmpCurrentToken=tmpCharacter;continue;}// [ TOKENS ]
|
|
3572
3618
|
if(tmpCharacter in this.ExpressionParser.tokenRadix){let tmpTokenRadix=this.ExpressionParser.tokenRadix[tmpCharacter];// If the token is a literal and has only one entry, it is a single character token and we can just safely add it.
|
|
3573
3619
|
if(tmpTokenRadix.TokenCount==1&&tmpTokenRadix.Literal){if(tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}tmpCurrentToken='';tmpCurrentTokenType=false;tmpResults.RawTokens.push(tmpCharacter);continue;}else{// This one has multiple options, so literals don't matter. We need to check the token map.
|
|
3574
3620
|
// The token radix TokenKeys array is sorted longest to shortest
|
|
@@ -3598,7 +3644,7 @@ tmpCurrentTokenType='Value';tmpCurrentToken+=tmpCharacter;// continue;
|
|
|
3598
3644
|
// }
|
|
3599
3645
|
// tmpResults.ExpressionParserLog.push(`ExpressionParser.tokenize found an unknown character code ${tmpCharCode} character ${tmpCharacter} in the expression: ${pExpression} at index ${i}`);
|
|
3600
3646
|
// this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);
|
|
3601
|
-
}if(tmpCurrentTokenType&&tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}return tmpResults.RawTokens;}}module.exports=ExpressionTokenizer;},{"./Fable-Service-ExpressionParser-Base.js":141}],143:[function(require,module,exports){module.exports={"sqrt":{"Name":"Square Root","Address":"fable.Math.sqrtPrecise"},"percent":{"Name":"Compute Percent (in IS over OF format)","Address":"fable.Math.percentagePrecise"},"compare":{"Name":"Compare","Address":"fable.Math.comparePrecise"},"abs":{"Name":"Absolute Value","Address":"fable.Math.absPrecise"},"floor":{"Name":"Floor Value","Address":"fable.Math.floorPrecise"},"ceil":{"Name":"Ceiling Value","Address":"fable.Math.ceilPrecise"},"rad":{"Name":"Degrees to Radians","Address":"fable.Math.radPrecise"},"pi":{"Name":"Pi","Address":"fable.Math.piPrecise"},"euler":{"Name":"Euler","Address":"fable.Math.eulerPrecise"},"sin":{"Name":"Sine","Address":"fable.Math.sin"},"cos":{"Name":"Cosine","Address":"fable.Math.cos"},"tan":{"Name":"Tangent","Address":"fable.Math.tan"},"count":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"countset":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"sortset":{"Name":"Sort Set","Address":"fable.Math.sortSetPrecise"},"bucketset":{"Name":"Bucket Set","Address":"fable.Math.bucketSetPrecise"},"sorthistogram":{"Name":"Sort Histogram","Address":"fable.Math.sortHistogramPrecise"},"max":{"Name":"Maximum","Address":"fable.Math.maxPrecise"},"min":{"Name":"Minimum","Address":"fable.Math.minPrecise"},"sum":{"Name":"Sum","Address":"fable.Math.sumPrecise"},"avg":{"Name":"Average","Address":"fable.Math.averagePrecise"},"mean":{"Name":"Mean","Address":"fable.Math.meanPrecise"},"median":{"Name":"Median","Address":"fable.Math.medianPrecise"},"mode":{"Name":"Mode","Address":"fable.Math.modePrecise"},"round":{"Name":"Round","Address":"fable.Math.roundPrecise"},"tofixed":{"Name":"To Fixed","Address":"fable.Math.toFixedPrecise"},"cumulativesummation":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.cumulativeSummation"},"countsetelements":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.countSetElements"},"getvalue":{"Name":"Get Value from Application State or Services (AppData, etc.)","Address":"fable.Utility.getInternalValueByHash"},"entryinset":{"Name":"Entry in Set","Address":"fable.Math.entryInSet"},"smallestInSet":{"Name":"Smallest in Set","Address":"fable.Math.smallestInSet"},"largestInSet":{"Name":"Largest in Set","Address":"fable.Math.largestInSet"},"aggregationhistogram":{"Name":"Generate a Histogram by Exact Value Aggregation","Address":"fable.Math.histogramAggregationByExactValueFromInternalState"},"distributionhistogram":{"Name":"Generate a Histogram Based on Value Distribution","Address":"fable.Math.histogramDistributionByExactValueFromInternalState"},"setconcatenate":{"Name":"Set Concatenate","Address":"fable.Math.setConcatenate"},"getvaluearray":{"Name":"Get Value Array from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueArrayByHashParametersFromInternal"},"getvalueobject":{"Name":"Get Value Object from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueObjectByHashParametersFromInternal"},"cleanvaluearray":{"Name":"Clean Value Array","Address":"fable.Math.cleanValueArray"},"cleanvalueobject":{"Name":"Clean Value Object","Address":"fable.Math.cleanValueObject"},"randominteger":{"Name":"Random Integer","Address":"fable.DataGeneration.randomInteger"},"randomintegerbetween":{"Name":"Random Integer Between Two Numbers","Address":"fable.DataGeneration.randomIntegerBetween"},"randomintegerupto":{"Name":"Random Integer","Address":"fable.DataGeneration.randomIntegerUpTo"},"randomfloat":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloat"},"randomfloatbetween":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatBetween"},"randomfloatupto":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatUpTo"},"datedaydifference":{"Name":"Date Difference in Days","Address":"fable.Dates.dateDayDifference"},"dateweekdifference":{"Name":"Date Difference in Weeks","Address":"fable.Dates.dateWeekDifference"},"datemonthdifference":{"Name":"Date Difference in Months","Address":"fable.Dates.dateMonthDifference"},"dateyeardifference":{"Name":"Date Difference in Years","Address":"fable.Dates.dateYearDifference"},"createValueObjectByHashes":{"Name":"Create Value Object by Hashes","Address":"fable.Utility.createValueObjectByHashes"}};},{}],144:[function(require,module,exports){const libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');class ExpressionParserLinter extends libExpressionParserOperationBase{constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);this.serviceType='ExpressionParser-Linter';}lintTokenizedExpression(pTokenizedExpression,pResultObject){let tmpResults=typeof pResultObject==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.LinterResults=[];// Guard against bad data being passed in
|
|
3647
|
+
}if(tmpCurrentTokenType&&tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}return tmpResults.RawTokens;}}module.exports=ExpressionTokenizer;},{"./Fable-Service-ExpressionParser-Base.js":141}],143:[function(require,module,exports){module.exports={"sqrt":{"Name":"Square Root","Address":"fable.Math.sqrtPrecise"},"percent":{"Name":"Compute Percent (in IS over OF format)","Address":"fable.Math.percentagePrecise"},"compare":{"Name":"Compare","Address":"fable.Math.comparePrecise"},"abs":{"Name":"Absolute Value","Address":"fable.Math.absPrecise"},"floor":{"Name":"Floor Value","Address":"fable.Math.floorPrecise"},"ceil":{"Name":"Ceiling Value","Address":"fable.Math.ceilPrecise"},"rad":{"Name":"Degrees to Radians","Address":"fable.Math.radPrecise"},"pi":{"Name":"Pi","Address":"fable.Math.piPrecise"},"euler":{"Name":"Euler","Address":"fable.Math.eulerPrecise"},"sin":{"Name":"Sine","Address":"fable.Math.sin"},"cos":{"Name":"Cosine","Address":"fable.Math.cos"},"tan":{"Name":"Tangent","Address":"fable.Math.tan"},"count":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"countset":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"sortset":{"Name":"Sort Set","Address":"fable.Math.sortSetPrecise"},"bucketset":{"Name":"Bucket Set","Address":"fable.Math.bucketSetPrecise"},"sorthistogram":{"Name":"Sort Histogram","Address":"fable.Math.sortHistogramPrecise"},"max":{"Name":"Maximum","Address":"fable.Math.maxPrecise"},"min":{"Name":"Minimum","Address":"fable.Math.minPrecise"},"sum":{"Name":"Sum","Address":"fable.Math.sumPrecise"},"avg":{"Name":"Average","Address":"fable.Math.averagePrecise"},"mean":{"Name":"Mean","Address":"fable.Math.meanPrecise"},"median":{"Name":"Median","Address":"fable.Math.medianPrecise"},"mode":{"Name":"Mode","Address":"fable.Math.modePrecise"},"round":{"Name":"Round","Address":"fable.Math.roundPrecise"},"tofixed":{"Name":"To Fixed","Address":"fable.Math.toFixedPrecise"},"cumulativesummation":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.cumulativeSummation"},"countsetelements":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.countSetElements"},"getvalue":{"Name":"Get Value from Application State or Services (AppData, etc.)","Address":"fable.Utility.getInternalValueByHash"},"findfirstvaluebyexactmatch":{"Name":"find + map on array of objects?","Address":"fable.Utility.findFirstValueByExactMatchInternal"},"findfirstvaluebystringincludes":{"Name":"find + map on array of objects?","Address":"fable.Utility.findFirstValueByStringIncludesInternal"},"concat":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsInternal"},"concatraw":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsRawInternal"},"join":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsInternal"},"joinraw":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsRawInternal"},"entryinset":{"Name":"Entry in Set","Address":"fable.Math.entryInSet"},"smallestInSet":{"Name":"Smallest in Set","Address":"fable.Math.smallestInSet"},"largestInSet":{"Name":"Largest in Set","Address":"fable.Math.largestInSet"},"aggregationhistogram":{"Name":"Generate a Histogram by Exact Value Aggregation","Address":"fable.Math.histogramAggregationByExactValueFromInternalState"},"distributionhistogram":{"Name":"Generate a Histogram Based on Value Distribution","Address":"fable.Math.histogramDistributionByExactValueFromInternalState"},"setconcatenate":{"Name":"Set Concatenate","Address":"fable.Math.setConcatenate"},"getvaluearray":{"Name":"Get Value Array from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueArrayByHashParametersFromInternal"},"getvalueobject":{"Name":"Get Value Object from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueObjectByHashParametersFromInternal"},"cleanvaluearray":{"Name":"Clean Value Array","Address":"fable.Math.cleanValueArray"},"cleanvalueobject":{"Name":"Clean Value Object","Address":"fable.Math.cleanValueObject"},"randominteger":{"Name":"Random Integer","Address":"fable.DataGeneration.randomInteger"},"randomintegerbetween":{"Name":"Random Integer Between Two Numbers","Address":"fable.DataGeneration.randomIntegerBetween"},"randomintegerupto":{"Name":"Random Integer","Address":"fable.DataGeneration.randomIntegerUpTo"},"randomfloat":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloat"},"randomfloatbetween":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatBetween"},"randomfloatupto":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatUpTo"},"datedaydifference":{"Name":"Date Difference in Days","Address":"fable.Dates.dateDayDifference"},"dateweekdifference":{"Name":"Date Difference in Weeks","Address":"fable.Dates.dateWeekDifference"},"datemonthdifference":{"Name":"Date Difference in Months","Address":"fable.Dates.dateMonthDifference"},"dateyeardifference":{"Name":"Date Difference in Years","Address":"fable.Dates.dateYearDifference"},"createValueObjectByHashes":{"Name":"Create Value Object by Hashes","Address":"fable.Utility.createValueObjectByHashes"}};},{}],144:[function(require,module,exports){const libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');class ExpressionParserLinter extends libExpressionParserOperationBase{constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);this.serviceType='ExpressionParser-Linter';}lintTokenizedExpression(pTokenizedExpression,pResultObject){let tmpResults=typeof pResultObject==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.LinterResults=[];// Guard against bad data being passed in
|
|
3602
3648
|
if(!Array.isArray(pTokenizedExpression)){tmpResults.ExpressionParserLog.push(`ERROR: ExpressionParser.lintTokenizedExpression was passed a non-array tokenized expression.`);tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return pTokenizedExpression;}if(pTokenizedExpression.length<1){tmpResults.ExpressionParserLog.push(`ERROR: ExpressionParser.lintTokenizedExpression was passed an empty tokenized expression.`);tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return pTokenizedExpression;}// 1. Check for balanced parenthesis
|
|
3603
3649
|
let tmpParenthesisDepth=0;// If it is in a state address, we don't care about the parenthesis
|
|
3604
3650
|
// State addresses are between squiggly brackets
|
|
@@ -4382,6 +4428,14 @@ this.fable.log.error(`Could not parse date string ${pISOString} with dayJS.`);re
|
|
|
4382
4428
|
* @returns {any} - The value from the object
|
|
4383
4429
|
*/findFirstValueByStringIncludes(pObjectArray,pValueToMatchAddress,pValueToMatch,pValueAddress){// Lazily create a manifest if it doesn't exist
|
|
4384
4430
|
if(!this.manifest){this.manifest=this.fable.newManyfest();}if(!Array.isArray(pObjectArray)){return undefined;}for(let i=0;i<pObjectArray.length;i++){let tmpValueToMatch=this.manifest.getValueByHash(pObjectArray[i],pValueToMatchAddress);if(tmpValueToMatch&&tmpValueToMatch.includes(pValueToMatch)){return this.manifest.getValueByHash(pObjectArray[i],pValueAddress);}}return undefined;}/**
|
|
4431
|
+
* Find the first value in an object that contains a specific value
|
|
4432
|
+
* @param {string} pFableAddress - The address in the fable object to pull the value from
|
|
4433
|
+
* @param {string} pValueToMatchAddress - The manyfest hash/address of the value to match
|
|
4434
|
+
* @param {string} pValueToMatch - The value to match
|
|
4435
|
+
* @param {string} pValueAddress - The manyfest hash/address of the value to return
|
|
4436
|
+
* @returns {any} - The value from the object
|
|
4437
|
+
*/findFirstValueByStringIncludesInternal(pFableAddress,pValueToMatchAddress,pValueToMatch,pValueAddress){// Lazily create a manifest if it doesn't exist
|
|
4438
|
+
if(!this.manifest){this.manifest=this.fable.newManyfest();}if(typeof pFableAddress!='string'){return undefined;}let tmpObjectArray=this.manifest.getValueByHash(this.fable,pFableAddress);return this.findFirstValueByStringIncludes(tmpObjectArray,pValueToMatchAddress,pValueToMatch,pValueAddress);}/**
|
|
4385
4439
|
* Find the first value in an object that contains a specific value
|
|
4386
4440
|
* @param {array} pObjectArray - The array of objects to search
|
|
4387
4441
|
* @param {string} pValueToMatchAddress - The manyfest hash/address of the value to match
|
|
@@ -4389,5 +4443,13 @@ if(!this.manifest){this.manifest=this.fable.newManyfest();}if(!Array.isArray(pOb
|
|
|
4389
4443
|
* @param {string} pValueAddress - The manyfest hash/address of the value to return
|
|
4390
4444
|
* @returns {any} - The value from the object
|
|
4391
4445
|
*/findFirstValueByExactMatch(pObjectArray,pValueToMatchAddress,pValueToMatch,pValueAddress){// Lazily create a manifest if it doesn't exist
|
|
4392
|
-
if(!this.manifest){this.manifest=this.fable.newManyfest();}if(!Array.isArray(pObjectArray)){return undefined;}for(let i=0;i<pObjectArray.length;i++){let tmpValueToMatch=this.manifest.getValueByHash(pObjectArray[i],pValueToMatchAddress);if(tmpValueToMatch&&tmpValueToMatch==pValueToMatch){return this.manifest.getValueByHash(pObjectArray[i],pValueAddress);}}return undefined;}
|
|
4446
|
+
if(!this.manifest){this.manifest=this.fable.newManyfest();}if(!Array.isArray(pObjectArray)){return undefined;}for(let i=0;i<pObjectArray.length;i++){let tmpValueToMatch=this.manifest.getValueByHash(pObjectArray[i],pValueToMatchAddress);if(tmpValueToMatch&&tmpValueToMatch==pValueToMatch){return this.manifest.getValueByHash(pObjectArray[i],pValueAddress);}}return undefined;}/**
|
|
4447
|
+
* Find the first value in an object that contains a specific value
|
|
4448
|
+
* @param {string} pFableAddress - The address in the fable object to pull the value from
|
|
4449
|
+
* @param {string} pValueToMatchAddress - The manyfest hash/address of the value to match
|
|
4450
|
+
* @param {string} pValueToMatch - The value to match
|
|
4451
|
+
* @param {string} pValueAddress - The manyfest hash/address of the value to return
|
|
4452
|
+
* @returns {any} - The value from the object
|
|
4453
|
+
*/findFirstValueByExactMatchInternal(pFableAddress,pValueToMatchAddress,pValueToMatch,pValueAddress){// Lazily create a manifest if it doesn't exist
|
|
4454
|
+
if(!this.manifest){this.manifest=this.fable.newManyfest();}if(typeof pFableAddress!='string'){return undefined;}let tmpObjectArray=this.manifest.getValueByHash(this.fable,pFableAddress);return this.findFirstValueByExactMatch(tmpObjectArray,pValueToMatchAddress,pValueToMatch,pValueAddress);}}module.exports=FableServiceUtility;},{"async.eachlimit":1,"async.waterfall":15,"big.js":17,"fable-serviceproviderbase":53}]},{},[132])(132);});
|
|
4393
4455
|
//# sourceMappingURL=fable.js.map
|