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.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
- extend(pDestinationObject){for(var _len2=arguments.length,pSourceObjects=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){pSourceObjects[_key2-1]=arguments[_key2];}return Object.assign(pDestinationObject,...pSourceObjects);}// Underscore and lodash have a behavior, _.template, which compiles a
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
- var tmpDateParts=pISOString.split(/\D+/);// Set up a date object with the current time.
2938
- var tmpReturnDate=new Date();// Manually parse the parts of the string and set each part for the
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]));// Track the number of hours we need to adjust the date by based on the timezone.
2946
- var tmpTimeZoneOffsetInHours=0;// If there's a value for either the hours or minutes offset.
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.