UNPKG

laravel-mix-glob

Version:

Laravel mix extension that add support for globs usage with an extensive concise api. For a more natural boosted productivity and dynamic. Configure once and forget about adding the files each time.

3 lines (2 loc) 1.17 kB
"use strict";var e=require("../Logger/index.js"),r=require("child_process"),s=require("os");function t(e,r){return r-e}exports.ascSortFn=function(e,r){return t(r,e)},exports.blockingSleep=function(e=999999999){const t="win32"===s.platform()?`timeout /t ${e}`:`sleep ${e}`;if(-1!==e)r.execSync(t,{stdio:"ignore"});else for(;;)r.execSync(t,{stdio:"ignore"})},exports.descSortFn=t,exports.isChildProcess=function(){return"true"===process.env.MIX_GLOB_IS_CHILD},exports.isEnterChar=function(e){return["\n","\r"].some((r=>e.includes(r)))},exports.isJestTest=function(){return void 0!==process.env.JEST_WORKER_ID},exports.isProcessRunning=function(e){try{return process.kill(e,0),!0}catch(e){return!1}},exports.killProcess=function(r,s="SIGTERM"){try{return e.LOGGER.debug(`Trying to kill process (pid: ${r})`),process.kill(r,s),e.LOGGER.debug("Process killed successfully"),!0}catch(r){return e.LOGGER.debug("Error killing process",r.message),!1}},exports.runMacroTask=function(e){return new Promise(((r,s)=>{setTimeout((async()=>{try{r(await e())}catch(e){s(e)}}),0)}))},exports.stringify=function(e){return JSON.stringify(e,null,4)}; //# sourceMappingURL=index.js.map