fable 3.0.61 → 3.0.63
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/fable.compatible.js +8 -6
- package/dist/fable.compatible.min.js +1 -1
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +9 -7
- package/dist/fable.min.js +2 -2
- package/dist/fable.min.js.map +1 -1
- package/package.json +3 -3
- package/source/Fable-ServiceManager.js +13 -13
- package/source/Fable.js +1 -1
- package/source/services/Fable-Service-DataGeneration.js +1 -1
- package/source/services/Fable-Service-MetaTemplate.js +1 -1
- package/source/services/Fable-Service-RestClient.js +1 -1
- package/source/services/Fable-Service-Utility.js +19 -10
- package/test/DataFormat-StringDateFormatting_tests.js +4 -4
- package/test/DataFormat-StringManipulation_tests.js +12 -12
- package/test/DataFormat-StringNumberFormatting_tests.js +3 -3
- package/test/DataFormat-StringTokenization_tests.js +5 -5
- package/test/FableOperation_tests.js +5 -5
- package/test/FableServiceManager_tests.js +27 -27
- package/test/Fable_tests.js +1 -1
- package/test/Utility_tests.js +34 -32
package/dist/fable.js
CHANGED
|
@@ -2913,7 +2913,9 @@ const libAsyncWaterfall=require('async.waterfall');const libAsyncEachLimit=requi
|
|
|
2913
2913
|
constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);this.templates={};// These two functions are used extensively throughout
|
|
2914
2914
|
this.waterfall=libAsyncWaterfall;this.eachLimit=libAsyncEachLimit;}// Underscore and lodash have a behavior, _.extend, which merges objects.
|
|
2915
2915
|
// Now that es6 gives us this, use the native thingy.
|
|
2916
|
-
|
|
2916
|
+
// Nevermind, the native thing is not stable enough across environments
|
|
2917
|
+
// Basic shallow copy
|
|
2918
|
+
extend(pDestinationObject){for(let i=0;i<(arguments.length<=1?0:arguments.length-1);i++){let tmpSourceObject=i+1<1||arguments.length<=i+1?undefined:arguments[i+1];let tmpObjectProperties=Object.keys(tmpSourceObject);for(let k=0;k<tmpObjectProperties.length;k++){pDestinationObject[tmpObjectProperties[k]]=tmpSourceObject[tmpObjectProperties[k]];}}return pDestinationObject;}// Underscore and lodash have a behavior, _.template, which compiles a
|
|
2917
2919
|
// string-based template with code snippets into simple executable pieces,
|
|
2918
2920
|
// with the added twist of returning a precompiled function ready to go.
|
|
2919
2921
|
template(pTemplateText,pData){let tmpTemplate=this.fable.serviceManager.instantiateServiceProviderWithoutRegistration('Template');return tmpTemplate.buildTemplateFunction(pTemplateText,pData);}// Build a template function from a template hash, and, register it with the service provider
|
|
@@ -2934,18 +2936,18 @@ let tmpChunkSize=typeof pChunkSize=='number'?pChunkSize:0;let tmpChunkCache=type
|
|
|
2934
2936
|
// This *is* meant to be a simple, small, and fast way to convert ISO strings to dates in engines
|
|
2935
2937
|
// with ultra limited JS capabilities where those don't work.
|
|
2936
2938
|
isoStringToDate(pISOString){// Split the string into an array based on the digit groups.
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
+
let tmpDateParts=pISOString.split(/\D+/);// Set up a date object with the current time.
|
|
2940
|
+
let tmpReturnDate=new Date();// Track the number of hours we need to adjust the date by based on the timezone.
|
|
2941
|
+
let tmpTimeZoneOffsetInHours=0;// Track the number of minutes we need to adjust the date by based on the timezone.
|
|
2942
|
+
let tmpTimeZoneOffsetInMinutes=0;// Manually parse the parts of the string and set each part for the
|
|
2939
2943
|
// date. Note: Using the UTC versions of these functions is necessary
|
|
2940
2944
|
// because we're manually adjusting for time zones stored in the
|
|
2941
2945
|
// string.
|
|
2942
2946
|
tmpReturnDate.setUTCFullYear(parseInt(tmpDateParts[0]));// The month numbers are one "off" from what normal humans would expect
|
|
2943
2947
|
// because January == 0.
|
|
2944
2948
|
tmpReturnDate.setUTCMonth(parseInt(tmpDateParts[1]-1));tmpReturnDate.setUTCDate(parseInt(tmpDateParts[2]));// Set the time parts of the date object.
|
|
2945
|
-
tmpReturnDate.setUTCHours(parseInt(tmpDateParts[3]));tmpReturnDate.setUTCMinutes(parseInt(tmpDateParts[4]));tmpReturnDate.setUTCSeconds(parseInt(tmpDateParts[5]));tmpReturnDate.setUTCMilliseconds(parseInt(tmpDateParts[6]));//
|
|
2946
|
-
|
|
2947
|
-
if(tmpDateParts[7]||tmpDateParts[8]){// Track the number of minutes we need to adjust the date by based on the timezone.
|
|
2948
|
-
var tmpTimeZoneOffsetInMinutes=0;// If there's a value for the minutes offset.
|
|
2949
|
+
tmpReturnDate.setUTCHours(parseInt(tmpDateParts[3]));tmpReturnDate.setUTCMinutes(parseInt(tmpDateParts[4]));tmpReturnDate.setUTCSeconds(parseInt(tmpDateParts[5]));tmpReturnDate.setUTCMilliseconds(parseInt(tmpDateParts[6]));// If there's a value for either the hours or minutes offset.
|
|
2950
|
+
if(tmpDateParts[7]||tmpDateParts[8]){// If there's a value for the minutes offset.
|
|
2949
2951
|
if(tmpDateParts[8]){// Convert the minutes value into an hours value.
|
|
2950
2952
|
tmpTimeZoneOffsetInMinutes=parseInt(tmpDateParts[8])/60;}// Add the hours and minutes values to get the total offset in hours.
|
|
2951
2953
|
tmpTimeZoneOffsetInHours=parseInt(tmpDateParts[7])+tmpTimeZoneOffsetInMinutes;// If the sign for the timezone is a plus to indicate the timezone is ahead of UTC time.
|