pict 1.0.140 → 1.0.142

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.
@@ -804,9 +804,11 @@ if(this.servicesMap[pServiceType].hasOwnProperty(pServiceHash)){if(!this.hasOwnP
804
804
  function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports["new"]=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceBase;module.exports.CoreServiceProviderBase=libFableServiceBase.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"./services/Fable-Service-Anticipate.js":51,"./services/Fable-Service-CSVParser.js":52,"./services/Fable-Service-DataFormat.js":53,"./services/Fable-Service-DataGeneration.js":55,"./services/Fable-Service-DateManipulation.js":56,"./services/Fable-Service-EnvironmentData.js":57,"./services/Fable-Service-FilePersistence.js":58,"./services/Fable-Service-MetaTemplate.js":59,"./services/Fable-Service-Operation.js":63,"./services/Fable-Service-RestClient.js":64,"./services/Fable-Service-Template.js":65,"./services/Fable-Service-Utility.js":66,"cachetrax":22,"fable-log":43,"fable-serviceproviderbase":44,"fable-settings":47,"fable-uuid":49,"manyfest":89}],51:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceAnticipate=/*#__PURE__*/function(_libFableServiceBase){_inherits(FableServiceAnticipate,_libFableServiceBase);var _super9=_createSuper(FableServiceAnticipate);function FableServiceAnticipate(pFable,pOptions,pServiceHash){var _this14;_classCallCheck2(this,FableServiceAnticipate);_this14=_super9.call(this,pFable,pOptions,pServiceHash);_this14.serviceType='AsyncAnticipate';// The queue of operations waiting to run.
805
805
  _this14.operationQueue=[];_this14.erroredOperations=[];_this14.executingOperationCount=0;_this14.completedOperationCount=0;_this14.maxOperations=1;_this14.lastError=undefined;_this14.waitingFunctions=[];return _this14;}_createClass2(FableServiceAnticipate,[{key:"checkQueue",value:function checkQueue(){// This checks to see if we need to start any operations.
806
806
  if(this.operationQueue.length>0&&this.executingOperationCount<this.maxOperations){var tmpOperation=this.operationQueue.shift();this.executingOperationCount+=1;tmpOperation(this.buildAnticipatorCallback());}else if(this.waitingFunctions.length>0&&this.executingOperationCount<1){// If there are no operations left, and we have waiting functions, call them.
807
- for(var i=0;i<this.waitingFunctions.length;i++){this.log.trace('Calling waiting function.');this.waitingFunctions[i](this.lastError);}// Reset our state
807
+ for(var i=0;i<this.waitingFunctions.length;i++){//this.log.trace('Calling waiting function.')
808
+ this.waitingFunctions[i](this.lastError);}// Reset our state
808
809
  this.lastError=undefined;this.waitingFunctions=[];}}// Expects a function fAsynchronousFunction(fCallback)
809
- },{key:"anticipate",value:function anticipate(fAsynchronousFunction){this.log.trace('Adding a function...');this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}},{key:"buildAnticipatorCallback",value:function buildAnticipatorCallback(){// This uses closure-scoped state to track the callback state
810
+ },{key:"anticipate",value:function anticipate(fAsynchronousFunction){//this.log.trace('Adding a function...')
811
+ this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}},{key:"buildAnticipatorCallback",value:function buildAnticipatorCallback(){// This uses closure-scoped state to track the callback state
810
812
  var tmpCallbackState={Called:false,Error:undefined,OperationSet:this};return hoistedCallback;function hoistedCallback(pError){if(tmpCallbackState.Called){// If they call the callback twice, throw an error
811
813
  throw new Error("Anticipation async callback called twice...");}tmpCallbackState.Called=true;tmpCallbackState.error=pError;tmpCallbackState.OperationSet.executingOperationCount-=1;tmpCallbackState.OperationSet.completedOperationCount+=1;tmpCallbackState.OperationSet.checkQueue();}}},{key:"wait",value:function wait(fCallback){this.waitingFunctions.push(fCallback);this.checkQueue();}}]);return FableServiceAnticipate;}(libFableServiceBase);module.exports=FableServiceAnticipate;},{"fable-serviceproviderbase":44}],52:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
812
814
  * Parsing CSVs. Why? Because it's a thing that needs to be done.
@@ -1155,7 +1157,7 @@ return fCallback();}/**
1155
1157
  * @param {function} fCallback - The callback function to call when the parse is complete
1156
1158
  */},{key:"parseString",value:function parseString(pString,pParseTree,pData,fCallback){var _this24=this;if(typeof fCallback!=='function'){var tmpParserState=this.newParserState(pParseTree);for(var i=0;i<pString.length;i++){// TODO: This is not fast.
1157
1159
  this.parseCharacter(pString[i],tmpParserState,pData,fCallback);}this.flushOutputBuffer(tmpParserState);return tmpParserState.Output;}else{// This is the async mode
1158
- var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(_i3){tmpAnticipate.anticipate(function(fCallback){console.log("Running template for character [".concat(pString[_i3],"] index ").concat(_i3));_this24.parseCharacterAsync(pString[_i3],_tmpParserState,pData,fCallback);});};for(var _i3=0;_i3<pString.length;_i3++){_loop(_i3);}tmpAnticipate.wait(function(pError){// Flush the remaining data
1160
+ var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(_i3){tmpAnticipate.anticipate(function(fCallback){_this24.parseCharacterAsync(pString[_i3],_tmpParserState,pData,fCallback);});};for(var _i3=0;_i3<pString.length;_i3++){_loop(_i3);}tmpAnticipate.wait(function(pError){// Flush the remaining data
1159
1161
  _this24.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserState.Output);});}}}]);return StringParser;}();module.exports=StringParser;},{}],61:[function(require,module,exports){/**
1160
1162
  * Word Tree
1161
1163
  * @author Steven Velozo <steven@velozo.com>