/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/ng-apimock@1.4.9/tasks/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var async=require("async"),chokidar=require("chokidar"),fs=require("fs-extra"),processor_1=require("./processor");module.exports=function(){var e=new processor_1.default,o=".tmp/mocks/",r=require("../lib/utils");return{run:function(n){if(void 0===n)throw console.error("No configuration has been specified."),new Error("No configuration has been specified.");if(void 0===n.src)throw console.error("No mock source directory have been specified."),new Error("No mock source directory have been specified.");var c,i={baseUrl:n.baseUrl,source:n.src,done:void 0!==n.done?n.done:function(){},destination:void 0!==n.outputDir?n.outputDir:o};async.series({processMocks:function(o){console.info("Process all the mocks"),c=e.processMocks(i.source),o(null,"processed mocks")},registerMocks:function(e){console.info("Register mocks"),r.registerMocks(c),e(null,"registered mocks")},generateMockingInterface:function(o){console.info("Generate the mocking web interface"),e.generateMockingInterface(i.destination),o(null,"generated mocking interface")},generateProtractorMock:function(o){console.info("Generate protractor.mock.js"),e.generateProtractorMock(i.destination,i.baseUrl),o(null,200)}},(function(e){null!=e&&console.error(e),i.done()}))},watch:function(e){console.info("Watching",e,"for changes"),chokidar.watch(e+"/**/*.json",{ignored:/[\/\\]\./,persistent:!0}).on("add",(function(e){return n(e)})).on("change",(function(e){return n(e)})).on("unlink",(function(e){return n(e)}))}};function n(e){try{var o=fs.readJsonSync(e);r.updateMock(o)}catch(o){console.info(e,"contains invalid json")}}};
//# sourceMappingURL=/sm/a2dd36cf7513df5596a7cdb621ba8f3660b4740f145cc2c24ded0138efcac203.map